Skip to content

Commit 13305cd

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
1 parent aeb8fe6 commit 13305cd

File tree

3 files changed

+12
-4
lines changed

3 files changed

+12
-4
lines changed

tests/integration/__init__.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -390,6 +390,14 @@ 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, *args, **kwargs):
396+
return pytest.mark.xfail(SCYLLA_VERSION is not None
397+
and Version(get_scylla_version(SCYLLA_VERSION))
398+
< Version(kwargs.get('lt_scylla_vesrion')),
399+
reason=reason, *args, **kwargs)
400+
393401
incorrect_test = lambda reason='This test seems to be incorrect and should be fixed', *args, **kwargs: pytest.mark.xfail(reason=reason, *args, **kwargs)
394402

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

tests/integration/standard/test_cluster.py

Lines changed: 2 additions & 2 deletions
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,7 @@ 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", lt_scylla_vesrion="5.2")
292292
def test_invalid_protocol_negotation(self):
293293
"""
294294
Test for protocol negotiation when explicit versions are set

tests/integration/standard/test_metadata.py

Lines changed: 2 additions & 2 deletions
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

@@ -1210,7 +1210,7 @@ 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', lt_scylla_vesrion='5.2')
12141214
def test_case_sensitivity(self):
12151215
"""
12161216
Test that names that need to be escaped in CREATE statements are

0 commit comments

Comments
 (0)