diff --git a/tests/integration/__init__.py b/tests/integration/__init__.py index 7826f4bcf9..813033f946 100644 --- a/tests/integration/__init__.py +++ b/tests/integration/__init__.py @@ -390,6 +390,14 @@ 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, *args, **kwargs): + return pytest.mark.xfail(SCYLLA_VERSION is not None + and Version(get_scylla_version(SCYLLA_VERSION)) + < Version(kwargs.get('lt_scylla_vesrion')), + 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") diff --git a/tests/integration/standard/test_cluster.py b/tests/integration/standard/test_cluster.py index 43356dbd82..ad1b89d0e6 100644 --- a/tests/integration/standard/test_cluster.py +++ b/tests/integration/standard/test_cluster.py @@ -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 @@ -288,7 +288,7 @@ 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", lt_scylla_vesrion="5.2") 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 c561491ab4..dfc7c07fcd 100644 --- a/tests/integration/standard/test_metadata.py +++ b/tests/integration/standard/test_metadata.py @@ -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 @@ -1210,7 +1210,7 @@ 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', lt_scylla_vesrion='5.2') def test_case_sensitivity(self): """ Test that names that need to be escaped in CREATE statements are