-
Notifications
You must be signed in to change notification settings - Fork 42
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix cqlengine tests #210
Fix cqlengine tests #210
Conversation
We use pytest to run our tests, but cqlenginge inegration tests were using nose's setup_package / teardown_package functions which are not supported by pytest. This causes most of those tests to fail. This commit changes this to pytest's autouse fixture, increasing amount of passing tests in integration/cqlengine from 185 to 516.
Some integration tests use indexes on non-frozen collections. Support for those was merged to Scylla, but will be available from Scylla 5.2. Mark the tests that require such indexes, so they are not run with Scylla < 5.2.
Scylla returns not only `[applied]` column, but also the previous value of a row. Tests didn't allow it - this commit fixes the problem.
One test requires custom indexes, which are not supported by Scylla. Mark the test as such,so it's not executed with Scylla.
When creating a table with compaction strategy class like `org.apache.cassandra.db.compaction.LeveledCompactionStrategy` it will be siltently renamed by Scylla to `LeveledCompactionStrategy`. This caused some tests to fail, so this commit accomodates this behaviour.
Some tests check that specific amout of warnings is emited, but warnings module deduplicates warnings by default, causing those tests to fail. This commits disables this filtering to fix the tests.
Batch statements can be executed in (at least) 2 ways. 1. Using BatchStatement 2. Using SimpleStatement with string like `BEGIN BATCH ...` The second way was not handled by `was_applied` property of ResultSet`. This caused some tests to fail. This commit fixes the problem.
All the test should now pass so we can enable them.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great PR!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Just for some context, we didn't run those tests mostly cause we didn't touch/changed anything in the cqlengine code. So no changes, no much reason to run those. regardless there were some changes requested around cqlengine (some from @k0machi, as part of the work done on Argus) |
This gets us a step closed to fixing tests (see #207 for reference).
This PR fixes (or skips) all the tests in tests/integration/cqlengine and enables them in CI.
Changes are divided into commits - see commit messages and changes to learn about individual fixes.