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

CI: add integration tests with python 3.13 #336

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions tests/integration/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -390,6 +390,17 @@ def _id_and_mark(f):
requires_custom_payload = pytest.mark.skipif(SCYLLA_VERSION is not None or PROTOCOL_VERSION < 4,
reason='Scylla does not support custom payloads. Cassandra requires native protocol v4.0+')
xfail_scylla = lambda reason, *args, **kwargs: pytest.mark.xfail(SCYLLA_VERSION is not None, reason=reason, *args, **kwargs)


def xfail_scylla_version(reason, oss_scylla_version, ent_scylla_version, *args, **kwargs):

Choose a reason for hiding this comment

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

Maybe xfail_scylla_version_less_than? Current name doesn't properly convey the meaning.

Copy link
Author

Choose a reason for hiding this comment

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

Yeah, I thought maybe to support both options somehow, but I didn't had time todo so.

Copy link
Author

Choose a reason for hiding this comment

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

I think of putting the version into pytest_markeval_namespace so can use pytest.mark.xfail directly

current_version = Version(get_scylla_version(SCYLLA_VERSION) if SCYLLA_VERSION is not None else '0.0.0')
if current_version > Version("2018.1"):
lt_scylla_version = Version(ent_scylla_version)
else:
lt_scylla_version = Version(oss_scylla_version)
return pytest.mark.xfail(current_version < lt_scylla_version,
reason=reason, *args, **kwargs)

incorrect_test = lambda reason='This test seems to be incorrect and should be fixed', *args, **kwargs: pytest.mark.xfail(reason=reason, *args, **kwargs)

pypy = unittest.skipUnless(platform.python_implementation() == "PyPy", "Test is skipped unless it's on PyPy")
Expand Down
5 changes: 3 additions & 2 deletions tests/integration/standard/test_cluster.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
from tests.integration import use_cluster, get_server_versions, CASSANDRA_VERSION, \
execute_until_pass, execute_with_long_wait_retry, get_node, MockLoggingHandler, get_unsupported_lower_protocol, \
get_unsupported_upper_protocol, lessthanprotocolv3, protocolv6, local, CASSANDRA_IP, greaterthanorequalcass30, \
lessthanorequalcass40, DSE_VERSION, TestCluster, PROTOCOL_VERSION, xfail_scylla, incorrect_test
lessthanorequalcass40, DSE_VERSION, TestCluster, PROTOCOL_VERSION, xfail_scylla_version, incorrect_test
from tests.integration.util import assert_quiescent_pool_state
import sys

Expand Down Expand Up @@ -288,7 +288,8 @@ def test_protocol_negotiation(self):

cluster.shutdown()

@xfail_scylla("Failing with scylla because there is option to create a cluster with 'lower bound' protocol")
@xfail_scylla_version("Failing with scylla because there is option to create a cluster with 'lower bound' protocol",
oss_scylla_version="5.2", ent_scylla_version="2023.1")
def test_invalid_protocol_negotation(self):
"""
Test for protocol negotiation when explicit versions are set
Expand Down
7 changes: 4 additions & 3 deletions tests/integration/standard/test_metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
greaterthancass21, assert_startswith, greaterthanorequalcass40,
greaterthanorequaldse67, lessthancass40,
TestCluster, DSE_VERSION, requires_java_udf, requires_composite_type,
requires_collection_indexes, xfail_scylla)
requires_collection_indexes, xfail_scylla, xfail_scylla_version)

from tests.util import wait_until

Expand Down Expand Up @@ -502,7 +502,7 @@ def test_indexes(self):
self.assertIn('CREATE INDEX e_index', statement)

@greaterthancass21
@requires_collection_indexes
@xfail_scylla_version('failing cause of scylladb/scylladb#19278', oss_scylla_version='6.1', ent_scylla_version='2025.1')
def test_collection_indexes(self):

self.session.execute("CREATE TABLE %s.%s (a int PRIMARY KEY, b map<text, text>)"
Expand Down Expand Up @@ -1210,7 +1210,8 @@ def test_export_keyspace_schema_udts(self):
cluster.shutdown()

@greaterthancass21
@pytest.mark.xfail(reason='Column name in CREATE INDEX is not quoted. It\'s a bug in driver or in Scylla')
@xfail_scylla_version(reason='Column name in CREATE INDEX is not quoted. It\'s a bug in driver or in Scylla',
oss_scylla_version="5.2", ent_scylla_version="2023.1")
def test_case_sensitivity(self):
"""
Test that names that need to be escaped in CREATE statements are
Expand Down