This patch moves (after straightforward translation) the test "test_views_with_future_tombstone", a regression test for #5793, from the C++ boost framework to the Python cqlpy framework. The main motivation this move is the ease of debugging failures: During the work on a patch for #20679 (eliminating read-before-write) this test began to fail, and understanding where the C++ failed was near impossible: the Boost test framework reports that the test failed, but not in which line or why, and adding printouts to this huge source file require a ridiculous amount of time for recompilation every time. In contrast, the new pytest-based version shows exactly where the error is, beautifully: ``` > assert [] == list(cql.execute(f'select * from {mv}')) E assert [] == [Row(b=2, a=1, c=3, d=4, e=5)] test_materialized_view.py:1614: AssertionError ``` It shows exactly which assertion failed, and exactly what were the values that were compared. Beautiful and super helpful for debugging. Beyond the ease of debugging, moving this (and later, other) test to the cql-pytest framework has additional advantages: 1. The test was misplaced, in the cql_test source file, and it belongs with materialized views tests so let's use this opportunity to move it to the right place. 2. Can easily run the same test on multiple versions of Scylla, and also on Cassandra. It's a good way to confirm the test is correct. 3. No need to recompile the test after every attempt to fix the bug. The cql_query_test.cc is huge - over 6,000 lines - and takes over a minute to compile after every attempt to fix a bug. Refs #16134 (the issue asks to move all MV tests to cql-pytest) Signed-off-by: Nadav Har'El <nyh@scylladb.com> Closes scylladb/scylladb#21552
Scylla in-source tests.
For details on how to run the tests, see docs/dev/testing.md
Shared C++ utils, libraries are in lib/, for Python - pylib/
alternator - Python tests which connect to a single server and use the DynamoDB API unit, boost, raft - unit tests in C++ cqlpy - Python tests which connect to a single server and use CQL topology* - tests that set up clusters and add/remove nodes cql - approval tests that use CQL and pre-recorded output rest_api - tests for Scylla REST API Port 9000 scylla-gdb - tests for scylla-gdb.py helper script nodetool - tests for C++ implementation of nodetool
If you can use an existing folder, consider adding your test to it. New folders should be used for new large categories/subsystems, or when the test environment is significantly different from some existing suite, e.g. you plan to start scylladb with different configuration, and you intend to add many tests and would like them to reuse an existing Scylla cluster (clusters can be reused for tests within the same folder).
To add a new folder, create a new directory, and then
copy & edit its suite.ini.