Skip to content

Commit

Permalink
tests/integration: introduced @xfail_scylla_version
Browse files Browse the repository at this point in the history
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
  • Loading branch information
fruch committed Jul 2, 2024
1 parent aeb8fe6 commit 13305cd
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
8 changes: 8 additions & 0 deletions tests/integration/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
4 changes: 2 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,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
Expand Down
4 changes: 2 additions & 2 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 @@ -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
Expand Down

0 comments on commit 13305cd

Please sign in to comment.