In the past, we had very similar shell scripts for test/alternator/run, test/cql-pytest/run and test/redis/run. Most of the code of all three scripts was identical - dealing with starting Scylla in a temporary directory, running pytest, and so on. The code duplication meant that every time we fixed a bug in one of those scripts, or added an important boot-time parameter to Scylla, we needed to fix all three scripts. The solution was to convert the run scripts to Python, and to use a common library, test/cql-pytest/run.py, for the main features shared by all scripts - starting Scylla, waiting for protocols to be available, and running pytest. However, we only did this conversion for alternator and cql-pytest - redis remained the old shell scripts. This patch completes the conversion also for redis. As expected, no change was needed to the run.py library code, which was already strong enough for the needs of the redis tests. Fixes #9748. Signed-off-by: Nadav Har'El <nyh@scylladb.com> Message-Id: <20211207081423.1187847-1-nyh@scylladb.com>
Tests for Scylla with Redis API that should also pass, identically, against Redis.
Tests use the redis library for Redis API, and the pytest frameworks (both are available from Linux distributions, or with "pip install").
To run all tests against the local installation of Scylla with Redis API on
localhost:6379, just run pytest.
Some additional pytest options:
- To run all tests in a single file, do
pytest test_strings.py. - To run a single specific test, do
pytest test_strings.py::set. - Additional useful pytest options, especially useful for debugging tests:
- -v: show the names of each individual test running instead of just dots.
- -s: show the full output of running tests (by default, pytest captures the test's output and only displays it if a test fails)