Name | RLTest JSON |
Version |
0.7.15
JSON |
| download |
home_page | None |
Summary | Redis Modules Test Framework, allow to run tests on redis and modules on a variety of environments |
upload_time | 2025-01-14 09:20:44 |
maintainer | None |
docs_url | None |
author | Redis, Inc. |
requires_python | >=3.7.0 |
license | BSD-3-Clause |
keywords |
|
VCS |
|
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
|
[![license](https://img.shields.io/github/license/RedisLabsModules/RLTest.svg)](https://github.com/RedisLabsModules/RLTest/blob/master/LICENSE)
[![PyPI version](https://badge.fury.io/py/rltest.svg)](https://badge.fury.io/py/rltest)
[![CI](https://github.com/RedisLabsModules/RLTest/workflows/CI/badge.svg)](https://github.com/RedisLabsModules/RLTest/actions)
[![Version](https://img.shields.io/github/release/RedisLabsModules/RLTest.svg)](https://github.com/RedisLabsModules/RLTest/releases/latest)
[![Codecov](https://codecov.io/gh/RedisLabsModules/RLTest/branch/master/graph/badge.svg)](https://codecov.io/gh/RedisLabsModules/RLTest)
[![Known Vulnerabilities](https://snyk.io/test/github/RedisLabsModules/RLTest/badge.svg?targetFile=pyproject.toml)](https://snyk.io/test/github/RedisLabsModules/RLTest?targetFile=pyproject.toml)
# RLTest
Redis Labs Test Framework, allow running tests on redis and modules on a variety of environments.
Supported Environment: oss, oss-cluster, enterprise, enterprise-cluster
The framework allow you to write a test without environment specification and then run the test on all supported environment.
# Install
```
$ pip install git+https://github.com/RedisLabsModules/RLTest.git@master
```
# Usage:
```
$ RLTest --help
usage: RLTest [-h] [--version] [--module MODULE] [--module-args MODULE_ARGS]
[--env {oss,oss-cluster,enterprise,enterprise-cluster,existing-env,cluster_existing-env}]
[--existing-env-addr EXISTING_ENV_ADDR]
[--shards_ports SHARDS_PORTS]
[--cluster_address CLUSTER_ADDRESS]
[--oss_password OSS_PASSWORD]
[--cluster_credentials CLUSTER_CREDENTIALS]
[--cluster_node_timeout CLUSTER_NODE_TIMEOUT]
[--internal_password INTERNAL_PASSWORD]
[--oss-redis-path OSS_REDIS_PATH]
[--enterprise-redis-path ENTERPRISE_REDIS_PATH]
[--stop-on-failure] [-x] [--verbose] [--debug] [-t TEST]
[--env-only] [--clear-logs] [--log-dir LOG_DIR] [--use-slaves]
[--shards-count SHARDS_COUNT] [--download-enterprise-binaries]
[--proxy-binary-path PROXY_BINARY_PATH]
[--enterprise-lib-path ENTERPRISE_LIB_PATH] [-r]
[--use-aof] [--use-rdb-preamble]
[--debug-print] [-V] [--vg-suppressions VG_SUPPRESSIONS]
[--vg-options VG_OPTIONS] [--vg-no-leakcheck] [--vg-verbose]
[--vg-no-fail-on-errors] [-i] [--debugger DEBUGGER] [-s]
[--check-exitcode] [--unix] [--randomize-ports] [--collect-only]
[--tls] [--tls-cert-file TLS_CERT_FILE]
[--tls-key-file TLS_KEY_FILE]
[--tls-ca-cert-file TLS_CA_CERT_FILE]
Test Framework for redis and redis module
optional arguments:
-h, --help show this help message and exit
--version Print RLTest version and exit (default: False)
--module MODULE path to the module file. You can use `--module` more
than once but it imples that you explicitly specify
`--module-args` as well. Notice that on enterprise the
file should be a zip file packed with
[RAMP](https://github.com/RedisLabs/RAMP). (default:
None)
--module-args MODULE_ARGS
arguments to give to the module on loading (default:
None)
--env {oss,oss-cluster,enterprise,enterprise-cluster,existing-env,cluster_existing-env}, -e {oss,oss-cluster,enterprise,enterprise-cluster,existing-env,cluster_existing-env}
env on which to run the test (default: oss)
--existing-env-addr EXISTING_ENV_ADDR
Address of existing env, relevent only when running
with existing-env, cluster_existing-env (default:
localhost:6379)
--shards_ports SHARDS_PORTS
list of ports, the shards are listening to, relevent
only when running with cluster_existing-env (default:
None)
--cluster_address CLUSTER_ADDRESS
enterprise cluster ip, relevent only when running with
cluster_existing-env (default: None)
--oss_password OSS_PASSWORD
set redis password, relevant for oss and oss-cluster
environment (default: None)
--cluster_credentials CLUSTER_CREDENTIALS
enterprise cluster cluster_credentials
"username:password", relevent only when running with
cluster_existing-env (default: None)
--cluster_node_timeout CLUSTER_NODE_TIMEOUT
cluster node timeout in milliseconds
--internal_password INTERNAL_PASSWORD
Give an ability to execute commands on shards
directly, relevent only when running with
cluster_existing-env (default: )
--oss-redis-path OSS_REDIS_PATH
path to the oss redis binary (default: redis-server)
--enterprise-redis-path ENTERPRISE_REDIS_PATH
path to the enterprise redis binary (default:
~/.RLTest/opt/redislabs/bin/redis-server)
--redis-config-file REDIS_CONFIG_FILE
path to the redis configuration file (default: None)
--stop-on-failure stop running on failure (default: False)
-x, --exit-on-failure
Stop test execution and exit on first assertion
failure (default: False)
--verbose, -v print more information about the test (default: 0)
--debug stop before each test allow gdb attachment (default:
False)
-t TEST, --test TEST Specify test to run, in the form of "file:test"
(default: None)
--env-only start the env but do not run any tests (default:
False)
--clear-logs deleting the log direcotry before the execution
(default: False)
--log-dir LOG_DIR directory to write logs to (default: ./logs)
--use-slaves run env with slaves enabled (default: False)
--shards-count SHARDS_COUNT
Number shards in bdb (default: 1)
--download-enterprise-binaries
run env with slaves enabled (default: False)
--proxy-binary-path PROXY_BINARY_PATH
dmc proxy binary path (default:
~/.RLTest/opt/redislabs/bin/dmcproxy)
--enterprise-lib-path ENTERPRISE_LIB_PATH
path of needed libraries to run enterprise binaries
(default: ~/.RLTest/opt/redislabs/lib/)
-r, --env-reuse reuse exists env, this feature is based on best
efforts, if the env can not be reused then it will be
taken down. (default: False)
--use-aof use aof instead of rdb (default: False)
--use-rdb-preamble use rdb preamble when rewriting aof file (default: True)
--debug-print print debug messages (default: False)
-V, --vg, --use-valgrind
running redis under valgrind (assuming valgrind is
install on the machine) (default: False)
--vg-suppressions VG_SUPPRESSIONS
path valgrind suppressions file (default: None)
--vg-options VG_OPTIONS
valgrind [options] (default: None)
--vg-no-leakcheck Don't perform a leak check (default: False)
--vg-verbose Don't log valgrind output. Output to screen directly
(default: False)
--vg-no-fail-on-errors
Dont Fail test when valgrind reported any errors in
the run.By default on RLTest the return value from
Valgrind will be used to fail the tests.Use this
option when you wish to dry-run valgrind but not fail
the test on valgrind reported errors. (default: False)
-i, --interactive-debugger
runs the redis on a debuger (gdb/lldb)
interactivly.debugger interactive mode is only
possible on a single process and so unsupported on
cluste or with slaves.it is also not possible to use
valgrind on interactive mode.interactive mode direcly
applies: --no-output-catch and --stop-on-failure.it is
also implies that only one test will be run (if --env-
only was not specify), an error will be raise
otherwise. (default: False)
--debugger DEBUGGER Run specified command line as the debugger (default:
None)
-s, --no-output-catch
all output will be written to the stdout, no log
files. (default: False)
--check-exitcode Check redis process exit code (default: False)
--unix Use Unix domain sockets instead of TCP (default:
False)
--randomize-ports Randomize Redis listening port assignment rather
thanusing default port (default: False)
--collect-only Collect the tests and exit (default: False)
--tls Enable TLS Support and disable the non-TLS port
completely. TLS connections will be available at the
default non-TLS ports. (default: False)
--tls-cert-file TLS_CERT_FILE
/path/to/redis.crt (default: None)
--tls-key-file TLS_KEY_FILE
/path/to/redis.key (default: None)
--tls-ca-cert-file TLS_CA_CERT_FILE
/path/to/ca.crt (default: None)
```
## Sample usages
### Multiple modules
```
RLTest --module modules/module1.so --module-args '' --module modules/module2.so --module-args ''
```
# Configuration File
By default, the framework search for configuration file on the current directory. The configuration file name is: config.txt.
It is possible to specify different configuration file on command line using the '@' prefix, for example:
```
RLTest @myConfig.txt # search for myConfig.txt configuration file
```
The configuration file format is the same as the command line argument, i.e : '--< param_name > < param_val >'.
It is also possible to comment a specific lines in the configuration file using '#'.
Example:
```
-vv
--clear-logs
#--debug
```
# Test Example
```python
from RLTest import Env
import time
class testExample():
'''
run all tests on a single env without taking
env down between tests
'''
def __init__(self):
self.env = Env()
def testExample(self):
con = self.env.getConnection()
con.set('x', 1)
self.env.assertEqual(con.get('x'), '1')
def testExample1(self):
con = self.env.getConnection()
con.set('x', 1)
self.env.assertEqual(con.get('x'), '1')
self.env.assertFalse(True) # check failure
def testExample2(self):
con = self.env.getConnection()
con.set('x', 1)
self.env.assertEqual(con.get('x'), '1')
# run each test on different env
def test_example():
env = Env()
con = env.getConnection()
con.set('x', 1)
env.assertEqual(con.get('x'), '1')
def test_example_2():
env = Env()
env.assertOk(env.cmd('set', 'x', '1'))
env.expect('get', 'x').equal('1')
env.expect('lpush', 'list', '1', '2', '3').equal(3)
env.expect('lrange', 'list', '0', '-1').debugPrint().contains('1')
env.debugPrint('this is some debug printing')
def test_example_3():
env = Env(useSlaves=True, env='oss')
con = env.getConnection()
con.set('x', 1)
con2 = env.getSlaveConnection()
time.sleep(0.1)
env.assertEqual(con2.get('x'), '1')
```
Raw data
{
"_id": null,
"home_page": null,
"name": "RLTest",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.7.0",
"maintainer_email": null,
"keywords": null,
"author": "Redis, Inc.",
"author_email": "oss@redis.com",
"download_url": "https://files.pythonhosted.org/packages/c9/f6/c4575fc4e7f76917ff7007c42376c1d1a62cf2b3e15cac60ee7dd79ec8db/rltest-0.7.15.tar.gz",
"platform": null,
"description": "[![license](https://img.shields.io/github/license/RedisLabsModules/RLTest.svg)](https://github.com/RedisLabsModules/RLTest/blob/master/LICENSE)\n[![PyPI version](https://badge.fury.io/py/rltest.svg)](https://badge.fury.io/py/rltest)\n[![CI](https://github.com/RedisLabsModules/RLTest/workflows/CI/badge.svg)](https://github.com/RedisLabsModules/RLTest/actions)\n[![Version](https://img.shields.io/github/release/RedisLabsModules/RLTest.svg)](https://github.com/RedisLabsModules/RLTest/releases/latest)\n[![Codecov](https://codecov.io/gh/RedisLabsModules/RLTest/branch/master/graph/badge.svg)](https://codecov.io/gh/RedisLabsModules/RLTest)\n[![Known Vulnerabilities](https://snyk.io/test/github/RedisLabsModules/RLTest/badge.svg?targetFile=pyproject.toml)](https://snyk.io/test/github/RedisLabsModules/RLTest?targetFile=pyproject.toml)\n\n\n\n# RLTest\n\nRedis Labs Test Framework, allow running tests on redis and modules on a variety of environments.\n\nSupported Environment: oss, oss-cluster, enterprise, enterprise-cluster\n\nThe framework allow you to write a test without environment specification and then run the test on all supported environment.\n\n\n# Install\n```\n$ pip install git+https://github.com/RedisLabsModules/RLTest.git@master\n\n```\n\n# Usage:\n```\n$ RLTest --help\nusage: RLTest [-h] [--version] [--module MODULE] [--module-args MODULE_ARGS]\n [--env {oss,oss-cluster,enterprise,enterprise-cluster,existing-env,cluster_existing-env}]\n [--existing-env-addr EXISTING_ENV_ADDR]\n [--shards_ports SHARDS_PORTS]\n [--cluster_address CLUSTER_ADDRESS]\n [--oss_password OSS_PASSWORD]\n [--cluster_credentials CLUSTER_CREDENTIALS]\n [--cluster_node_timeout CLUSTER_NODE_TIMEOUT]\n [--internal_password INTERNAL_PASSWORD]\n [--oss-redis-path OSS_REDIS_PATH]\n [--enterprise-redis-path ENTERPRISE_REDIS_PATH]\n [--stop-on-failure] [-x] [--verbose] [--debug] [-t TEST]\n [--env-only] [--clear-logs] [--log-dir LOG_DIR] [--use-slaves]\n [--shards-count SHARDS_COUNT] [--download-enterprise-binaries]\n [--proxy-binary-path PROXY_BINARY_PATH]\n [--enterprise-lib-path ENTERPRISE_LIB_PATH] [-r]\n [--use-aof] [--use-rdb-preamble]\n [--debug-print] [-V] [--vg-suppressions VG_SUPPRESSIONS]\n [--vg-options VG_OPTIONS] [--vg-no-leakcheck] [--vg-verbose]\n [--vg-no-fail-on-errors] [-i] [--debugger DEBUGGER] [-s]\n [--check-exitcode] [--unix] [--randomize-ports] [--collect-only]\n [--tls] [--tls-cert-file TLS_CERT_FILE]\n [--tls-key-file TLS_KEY_FILE]\n [--tls-ca-cert-file TLS_CA_CERT_FILE]\n\nTest Framework for redis and redis module\n\noptional arguments:\n -h, --help show this help message and exit\n --version Print RLTest version and exit (default: False)\n --module MODULE path to the module file. You can use `--module` more\n than once but it imples that you explicitly specify\n `--module-args` as well. Notice that on enterprise the\n file should be a zip file packed with\n [RAMP](https://github.com/RedisLabs/RAMP). (default:\n None)\n --module-args MODULE_ARGS\n arguments to give to the module on loading (default:\n None)\n --env {oss,oss-cluster,enterprise,enterprise-cluster,existing-env,cluster_existing-env}, -e {oss,oss-cluster,enterprise,enterprise-cluster,existing-env,cluster_existing-env}\n env on which to run the test (default: oss)\n --existing-env-addr EXISTING_ENV_ADDR\n Address of existing env, relevent only when running\n with existing-env, cluster_existing-env (default:\n localhost:6379)\n --shards_ports SHARDS_PORTS\n list of ports, the shards are listening to, relevent\n only when running with cluster_existing-env (default:\n None)\n --cluster_address CLUSTER_ADDRESS\n enterprise cluster ip, relevent only when running with\n cluster_existing-env (default: None)\n --oss_password OSS_PASSWORD\n set redis password, relevant for oss and oss-cluster\n environment (default: None)\n --cluster_credentials CLUSTER_CREDENTIALS\n enterprise cluster cluster_credentials\n \"username:password\", relevent only when running with\n cluster_existing-env (default: None)\n --cluster_node_timeout CLUSTER_NODE_TIMEOUT\n cluster node timeout in milliseconds\n --internal_password INTERNAL_PASSWORD\n Give an ability to execute commands on shards\n directly, relevent only when running with\n cluster_existing-env (default: )\n --oss-redis-path OSS_REDIS_PATH\n path to the oss redis binary (default: redis-server)\n --enterprise-redis-path ENTERPRISE_REDIS_PATH\n path to the enterprise redis binary (default:\n ~/.RLTest/opt/redislabs/bin/redis-server)\n --redis-config-file REDIS_CONFIG_FILE\n path to the redis configuration file (default: None)\n --stop-on-failure stop running on failure (default: False)\n -x, --exit-on-failure\n Stop test execution and exit on first assertion\n failure (default: False)\n --verbose, -v print more information about the test (default: 0)\n --debug stop before each test allow gdb attachment (default:\n False)\n -t TEST, --test TEST Specify test to run, in the form of \"file:test\"\n (default: None)\n --env-only start the env but do not run any tests (default:\n False)\n --clear-logs deleting the log direcotry before the execution\n (default: False)\n --log-dir LOG_DIR directory to write logs to (default: ./logs)\n --use-slaves run env with slaves enabled (default: False)\n --shards-count SHARDS_COUNT\n Number shards in bdb (default: 1)\n --download-enterprise-binaries\n run env with slaves enabled (default: False)\n --proxy-binary-path PROXY_BINARY_PATH\n dmc proxy binary path (default:\n ~/.RLTest/opt/redislabs/bin/dmcproxy)\n --enterprise-lib-path ENTERPRISE_LIB_PATH\n path of needed libraries to run enterprise binaries\n (default: ~/.RLTest/opt/redislabs/lib/)\n -r, --env-reuse reuse exists env, this feature is based on best\n efforts, if the env can not be reused then it will be\n taken down. (default: False)\n --use-aof use aof instead of rdb (default: False)\n --use-rdb-preamble use rdb preamble when rewriting aof file (default: True)\n --debug-print print debug messages (default: False)\n -V, --vg, --use-valgrind\n running redis under valgrind (assuming valgrind is\n install on the machine) (default: False)\n --vg-suppressions VG_SUPPRESSIONS\n path valgrind suppressions file (default: None)\n --vg-options VG_OPTIONS\n valgrind [options] (default: None)\n --vg-no-leakcheck Don't perform a leak check (default: False)\n --vg-verbose Don't log valgrind output. Output to screen directly\n (default: False)\n --vg-no-fail-on-errors\n Dont Fail test when valgrind reported any errors in\n the run.By default on RLTest the return value from\n Valgrind will be used to fail the tests.Use this\n option when you wish to dry-run valgrind but not fail\n the test on valgrind reported errors. (default: False)\n -i, --interactive-debugger\n runs the redis on a debuger (gdb/lldb)\n interactivly.debugger interactive mode is only\n possible on a single process and so unsupported on\n cluste or with slaves.it is also not possible to use\n valgrind on interactive mode.interactive mode direcly\n applies: --no-output-catch and --stop-on-failure.it is\n also implies that only one test will be run (if --env-\n only was not specify), an error will be raise\n otherwise. (default: False)\n --debugger DEBUGGER Run specified command line as the debugger (default:\n None)\n -s, --no-output-catch\n all output will be written to the stdout, no log\n files. (default: False)\n --check-exitcode Check redis process exit code (default: False)\n --unix Use Unix domain sockets instead of TCP (default:\n False)\n --randomize-ports Randomize Redis listening port assignment rather\n thanusing default port (default: False)\n --collect-only Collect the tests and exit (default: False)\n --tls Enable TLS Support and disable the non-TLS port\n completely. TLS connections will be available at the\n default non-TLS ports. (default: False)\n --tls-cert-file TLS_CERT_FILE\n /path/to/redis.crt (default: None)\n --tls-key-file TLS_KEY_FILE\n /path/to/redis.key (default: None)\n --tls-ca-cert-file TLS_CA_CERT_FILE\n /path/to/ca.crt (default: None)\n\n```\n\n## Sample usages\n\n### Multiple modules\n\n```\nRLTest --module modules/module1.so --module-args '' --module modules/module2.so --module-args ''\n```\n\n# Configuration File\nBy default, the framework search for configuration file on the current directory. The configuration file name is: config.txt.\nIt is possible to specify different configuration file on command line using the '@' prefix, for example:\n```\nRLTest @myConfig.txt # search for myConfig.txt configuration file\n```\nThe configuration file format is the same as the command line argument, i.e : '--< param_name > < param_val >'.\n\nIt is also possible to comment a specific lines in the configuration file using '#'.\n\nExample:\n\n```\n-vv\n--clear-logs\n#--debug\n```\n\n\n# Test Example\n\n```python\nfrom RLTest import Env\nimport time\n\n\nclass testExample():\n '''\n run all tests on a single env without taking\n env down between tests\n '''\n def __init__(self):\n self.env = Env()\n\n def testExample(self):\n con = self.env.getConnection()\n con.set('x', 1)\n self.env.assertEqual(con.get('x'), '1')\n\n def testExample1(self):\n con = self.env.getConnection()\n con.set('x', 1)\n self.env.assertEqual(con.get('x'), '1')\n self.env.assertFalse(True) # check failure\n\n def testExample2(self):\n con = self.env.getConnection()\n con.set('x', 1)\n self.env.assertEqual(con.get('x'), '1')\n\n\n# run each test on different env\ndef test_example():\n env = Env()\n con = env.getConnection()\n con.set('x', 1)\n env.assertEqual(con.get('x'), '1')\n\n\ndef test_example_2():\n env = Env()\n env.assertOk(env.cmd('set', 'x', '1'))\n env.expect('get', 'x').equal('1')\n\n env.expect('lpush', 'list', '1', '2', '3').equal(3)\n env.expect('lrange', 'list', '0', '-1').debugPrint().contains('1')\n env.debugPrint('this is some debug printing')\n\n\ndef test_example_3():\n env = Env(useSlaves=True, env='oss')\n con = env.getConnection()\n con.set('x', 1)\n con2 = env.getSlaveConnection()\n time.sleep(0.1)\n env.assertEqual(con2.get('x'), '1')\n\n```\n",
"bugtrack_url": null,
"license": "BSD-3-Clause",
"summary": "Redis Modules Test Framework, allow to run tests on redis and modules on a variety of environments",
"version": "0.7.15",
"project_urls": {
"repository": "https://github.com/RedisLabsModules/RLTest"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "e6d0cdf55512b796c407e0f1f11f123a280a0fb53bef05b06c81a359ce238458",
"md5": "2f359f4ed5527f2218f55eb63fdde79a",
"sha256": "87bbfa83cf342c17dd3d2f84b7ee8e515ea98e48d2613fa2a9b75c3fb012e4b6"
},
"downloads": -1,
"filename": "rltest-0.7.15-py3-none-any.whl",
"has_sig": false,
"md5_digest": "2f359f4ed5527f2218f55eb63fdde79a",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.7.0",
"size": 45510,
"upload_time": "2025-01-14T09:20:42",
"upload_time_iso_8601": "2025-01-14T09:20:42.215389Z",
"url": "https://files.pythonhosted.org/packages/e6/d0/cdf55512b796c407e0f1f11f123a280a0fb53bef05b06c81a359ce238458/rltest-0.7.15-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "c9f6c4575fc4e7f76917ff7007c42376c1d1a62cf2b3e15cac60ee7dd79ec8db",
"md5": "6f4375d45fb30950530a5fab798cdcd9",
"sha256": "ed502adb1fc9ead9449d13401d6e6546fb3f9a45771115febe0ea19b2336aab9"
},
"downloads": -1,
"filename": "rltest-0.7.15.tar.gz",
"has_sig": false,
"md5_digest": "6f4375d45fb30950530a5fab798cdcd9",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.7.0",
"size": 40173,
"upload_time": "2025-01-14T09:20:44",
"upload_time_iso_8601": "2025-01-14T09:20:44.075801Z",
"url": "https://files.pythonhosted.org/packages/c9/f6/c4575fc4e7f76917ff7007c42376c1d1a62cf2b3e15cac60ee7dd79ec8db/rltest-0.7.15.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-01-14 09:20:44",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "RedisLabsModules",
"github_project": "RLTest",
"travis_ci": false,
"coveralls": true,
"github_actions": true,
"lcname": "rltest"
}