In issue #7722, it was suggested that we should port Cassandra's CQL unit tests into our own repository, by translating the Java tests into Python using the new cql-pytest framework. Cassandra's CQL unit test framework is orders of magnitude faster than dtest, and in-tree, so Cassandra have been moving many CQL correctness tests there, and we can also benefit from their test cases. In this patch, we take the first step in a long journey: 1. I created a subdirectory, test/cql-pytest/cassandra_tests, where all the translated Cassandra tests will reside. The structure of this directory will mirror that of the test/unit/org/apache/cassandra/cql3 directory in the Cassandra repository. pytest conveniently looks for test files recursively, so when all the cql-pytest are run, the cassandra_tests files will be run as well. As usual, one can also run only a subset of all the tests, e.g., "test/cql-pytest/run -vs cassandra_tests" runs only the tests in the cassandra_tests subdirectory (and its subdirectories). 2. I translated into Python two of the smallest test files - validation/entities/{TimeuuidTest,DataTypeTest}.java - containing just three test functions. The plan is to translate entire Java test files one by one, and to mirror their original location in our own repository, so it will be easier to remember what we already translated and what remains to be done. 3. I created a small library, porting.py, of functions which resemble the common functions of the Java tests (CQLTester.java). These functions aim to make porting the tests easier. Despite the resemblence, the ported code is not 100% identical (of course) and some effort is still required in this porting. As we continue this porting effort, we'll probably need more of these functions, can can also continue to improve them to reduce the porting effort. Refs #7722. Signed-off-by: Nadav Har'El <nyh@scylladb.com> Message-Id: <20201201192142.2285582-1-nyh@scylladb.com>
16 lines
769 B
Plaintext
16 lines
769 B
Plaintext
All tests in this directory and its subdirectories were translated from
|
|
Apache Cassandra's unit tests - the test/unit/org/apache/cassandra/cql3
|
|
directory in the Apache Cassandra source code repository.
|
|
|
|
The organization of this directory mirrors that of the Cassandra directory,
|
|
with test files renamed from SomeThingTest.java to some_thing_test.py.
|
|
|
|
Individual files were translated in their entirety, and each individual
|
|
file includes a comment on which version of the file was translated
|
|
(Cassandra's tests continue to evolve, so we may later want to catch up
|
|
with the differences).
|
|
|
|
Please avoid adding new tests, not translated from Cassandra, in this
|
|
directory. Instead, place new tests written from scratch for Scylla,
|
|
or improved tests, in the directory above.
|