Skip to content
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

Merged
merged 8 commits into from
Feb 8, 2023
Merged

Conversation

Lorak-mmk
Copy link

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.

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.
@Lorak-mmk Lorak-mmk mentioned this pull request Feb 6, 2023
6 tasks
@Lorak-mmk Lorak-mmk changed the title Fix clqengine tests Fix cqlengine tests Feb 6, 2023
Copy link

@avelanarius avelanarius left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great PR!

@Lorak-mmk Lorak-mmk requested a review from fruch February 6, 2023 17:51
Copy link

@fruch fruch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@fruch
Copy link

fruch commented Feb 6, 2023

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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants