Skip to content

Commit 4a15353

Browse files
committed
tests/integration: introduced @xfail_scylla_version
some test that was marked with @xfail_scylla, are now passing with newer release, i.e. some issue were fixed. so this new decorator can xfail up to a certion scylla_version note that it support both a oss version, and enterprise version
1 parent aeb8fe6 commit 4a15353

File tree

3 files changed

+18
-5
lines changed

3 files changed

+18
-5
lines changed

tests/integration/__init__.py

+11
Original file line numberDiff line numberDiff line change
@@ -390,6 +390,17 @@ def _id_and_mark(f):
390390
requires_custom_payload = pytest.mark.skipif(SCYLLA_VERSION is not None or PROTOCOL_VERSION < 4,
391391
reason='Scylla does not support custom payloads. Cassandra requires native protocol v4.0+')
392392
xfail_scylla = lambda reason, *args, **kwargs: pytest.mark.xfail(SCYLLA_VERSION is not None, reason=reason, *args, **kwargs)
393+
394+
395+
def xfail_scylla_version(reason, oss_scylla_version, ent_scylla_version, *args, **kwargs):
396+
current_version = Version(get_scylla_version(SCYLLA_VERSION) if SCYLLA_VERSION is not None else '0.0.0')
397+
if current_version > Version("2018.1"):
398+
lt_scylla_version = Version(ent_scylla_version)
399+
else:
400+
lt_scylla_version = Version(oss_scylla_version)
401+
return pytest.mark.xfail(current_version < lt_scylla_version,
402+
reason=reason, *args, **kwargs)
403+
393404
incorrect_test = lambda reason='This test seems to be incorrect and should be fixed', *args, **kwargs: pytest.mark.xfail(reason=reason, *args, **kwargs)
394405

395406
pypy = unittest.skipUnless(platform.python_implementation() == "PyPy", "Test is skipped unless it's on PyPy")

tests/integration/standard/test_cluster.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
from tests.integration import use_cluster, get_server_versions, CASSANDRA_VERSION, \
4343
execute_until_pass, execute_with_long_wait_retry, get_node, MockLoggingHandler, get_unsupported_lower_protocol, \
4444
get_unsupported_upper_protocol, lessthanprotocolv3, protocolv6, local, CASSANDRA_IP, greaterthanorequalcass30, \
45-
lessthanorequalcass40, DSE_VERSION, TestCluster, PROTOCOL_VERSION, xfail_scylla, incorrect_test
45+
lessthanorequalcass40, DSE_VERSION, TestCluster, PROTOCOL_VERSION, xfail_scylla_version, incorrect_test
4646
from tests.integration.util import assert_quiescent_pool_state
4747
import sys
4848

@@ -288,7 +288,8 @@ def test_protocol_negotiation(self):
288288

289289
cluster.shutdown()
290290

291-
@xfail_scylla("Failing with scylla because there is option to create a cluster with 'lower bound' protocol")
291+
@xfail_scylla_version("Failing with scylla because there is option to create a cluster with 'lower bound' protocol",
292+
oss_scylla_version="5.2", ent_scylla_version="2023.1")
292293
def test_invalid_protocol_negotation(self):
293294
"""
294295
Test for protocol negotiation when explicit versions are set

tests/integration/standard/test_metadata.py

+4-3
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
greaterthancass21, assert_startswith, greaterthanorequalcass40,
4242
greaterthanorequaldse67, lessthancass40,
4343
TestCluster, DSE_VERSION, requires_java_udf, requires_composite_type,
44-
requires_collection_indexes, xfail_scylla)
44+
requires_collection_indexes, xfail_scylla, xfail_scylla_version)
4545

4646
from tests.util import wait_until
4747

@@ -502,7 +502,7 @@ def test_indexes(self):
502502
self.assertIn('CREATE INDEX e_index', statement)
503503

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

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

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

0 commit comments

Comments
 (0)