diff --git a/.github/workflows/integration-tests.yml b/.github/workflows/integration-tests.yml index 69d7335d9..bc22ca2a7 100644 --- a/.github/workflows/integration-tests.yml +++ b/.github/workflows/integration-tests.yml @@ -40,11 +40,11 @@ jobs: - name: Test with pytest run: | export EVENT_LOOP_MANAGER=${{ matrix.event_loop_manager }} - export SCYLLA_VERSION='release:5.1' + export SCYLLA_VERSION='release:6.2' ./scripts/run_integration_test.sh tests/integration/standard/ tests/integration/cqlengine/ - name: Test tablets run: | export EVENT_LOOP_MANAGER=${{ matrix.event_loop_manager }} - export SCYLLA_VERSION='release:6.0.2' + export SCYLLA_VERSION='release:6.2' ./scripts/run_integration_test.sh tests/integration/experiments/ diff --git a/tests/integration/__init__.py b/tests/integration/__init__.py index 633fee729..693ce4079 100644 --- a/tests/integration/__init__.py +++ b/tests/integration/__init__.py @@ -299,6 +299,8 @@ def get_unsupported_lower_protocol(): This is used to determine the lowest protocol version that is NOT supported by the version of C* running """ + if SCYLLA_VERSION is not None: + return 2 if CASSANDRA_VERSION >= Version('3.0'): return 2 else: @@ -310,6 +312,8 @@ def get_unsupported_upper_protocol(): This is used to determine the highest protocol version that is NOT supported by the version of C* running """ + if SCYLLA_VERSION is not None: + return 5 if CASSANDRA_VERSION >= Version('4.0-a'): if DSE_VERSION: @@ -819,6 +823,38 @@ def setup_keyspace(ipformat=None, wait=True, protocol_version=None, port=9042): cluster.shutdown() +def is_scylla_enterprise(version: Version) -> bool: + return version > Version('2000.1.1') + + +def xfail_scylla_version_lt(reason, oss_scylla_version, ent_scylla_version, *args, **kwargs): + """ + It is used to mark tests that are going to fail on certain scylla versions. + :param reason: message to fail test with + :param oss_scylla_version: str, oss version from which test supposed to succeed + :param ent_scylla_version: str, enterprise version from which test supposed to succeed. It should end with `.1.1` + """ + if not reason.startswith("scylladb/scylladb#"): + raise ValueError('reason should start with scylladb/scylladb# to reference issue in scylla repo') + + if not isinstance(ent_scylla_version, str): + raise ValueError('ent_scylla_version should be a str') + + if not ent_scylla_version.endswith("1.1"): + raise ValueError('ent_scylla_version should end with "1.1"') + + if SCYLLA_VERSION is None: + return pytest.mark.skipif(False, reason="It is just a NoOP Decor, should not skip anything") + + current_version = Version(get_scylla_version(SCYLLA_VERSION)) + + if is_scylla_enterprise(current_version): + return pytest.mark.xfail(current_version < Version(ent_scylla_version), + reason=reason, *args, **kwargs) + + return pytest.mark.xfail(current_version < Version(oss_scylla_version), reason=reason, *args, **kwargs) + + class UpDownWaiter(object): def __init__(self, host): diff --git a/tests/integration/cqlengine/management/test_management.py b/tests/integration/cqlengine/management/test_management.py index 75c0716cf..d364c9bbc 100644 --- a/tests/integration/cqlengine/management/test_management.py +++ b/tests/integration/cqlengine/management/test_management.py @@ -23,14 +23,15 @@ from cassandra.cqlengine.models import Model from cassandra.cqlengine import columns -from tests.integration import DSE_VERSION, PROTOCOL_VERSION, greaterthancass20, requires_collection_indexes, MockLoggingHandler, CASSANDRA_VERSION +from tests.integration import DSE_VERSION, PROTOCOL_VERSION, greaterthancass20, requires_collection_indexes, \ + MockLoggingHandler, CASSANDRA_VERSION, SCYLLA_VERSION, xfail_scylla from tests.integration.cqlengine.base import BaseCassEngTestCase from tests.integration.cqlengine.query.test_queryset import TestModel from cassandra.cqlengine.usertype import UserType from tests.integration.cqlengine import DEFAULT_KEYSPACE -INCLUDE_REPAIR = not CASSANDRA_VERSION >= Version('4-a') # This should cover DSE 6.0+ +INCLUDE_REPAIR = (not CASSANDRA_VERSION >= Version('4-a')) and SCYLLA_VERSION is None # This should cover DSE 6.0+ class KeyspaceManagementTest(BaseCassEngTestCase): @@ -429,6 +430,7 @@ def test_sync_index_case_sensitive(self): @greaterthancass20 @requires_collection_indexes + @xfail_scylla("scylladb/scylladb#22019 - Scylla incorrectly reports target as keys(%s) for sets") def test_sync_indexed_set(self): """ Tests that models that have container types with indices can be synced. diff --git a/tests/integration/standard/test_cluster.py b/tests/integration/standard/test_cluster.py index 7ffb25783..2e51ccf0c 100644 --- a/tests/integration/standard/test_cluster.py +++ b/tests/integration/standard/test_cluster.py @@ -288,7 +288,6 @@ def test_protocol_negotiation(self): cluster.shutdown() - @xfail_scylla("Failing with scylla because there is option to create a cluster with 'lower bound' protocol") def test_invalid_protocol_negotation(self): """ Test for protocol negotiation when explicit versions are set diff --git a/tests/integration/standard/test_metadata.py b/tests/integration/standard/test_metadata.py index ba9eeae43..fdffdaa2c 100644 --- a/tests/integration/standard/test_metadata.py +++ b/tests/integration/standard/test_metadata.py @@ -42,7 +42,7 @@ greaterthancass21, assert_startswith, greaterthanorequalcass40, greaterthanorequaldse67, lessthancass40, TestCluster, DSE_VERSION, requires_java_udf, requires_composite_type, - requires_collection_indexes, SCYLLA_VERSION) + requires_collection_indexes, SCYLLA_VERSION, xfail_scylla, xfail_scylla_version_lt) from tests.util import wait_until @@ -505,6 +505,7 @@ def test_indexes(self): @greaterthancass21 @requires_collection_indexes + @xfail_scylla('scylladb/scylladb#22013 - scylla does not show full index in system_schema.indexes') def test_collection_indexes(self): self.session.execute("CREATE TABLE %s.%s (a int PRIMARY KEY, b map)" @@ -1207,7 +1208,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_lt(reason='scylladb/scylladb#10707 - Column name in CREATE INDEX is not quoted', + oss_scylla_version="5.2", ent_scylla_version="2023.1.1") def test_case_sensitivity(self): """ Test that names that need to be escaped in CREATE statements are