Skip to content

Commit 90f071a

Browse files
Introduce skip_scylla_version_lt for integration tests
1 parent dad541c commit 90f071a

1 file changed

Lines changed: 21 additions & 0 deletions

File tree

tests/integration/__init__.py

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -707,6 +707,27 @@ def xfail_scylla_version_lt(reason, oss_scylla_version, ent_scylla_version, *arg
707707

708708
return pytest.mark.xfail(current_version < Version(oss_scylla_version), reason=reason, *args, **kwargs)
709709

710+
711+
def skip_scylla_version_lt(reason, scylla_version):
712+
"""
713+
Skip tests on scylla versions older than the specified thresholds.
714+
:param reason: message explaining why the test is skipped
715+
:param scylla_version: str, version from which test supposed to work
716+
"""
717+
if not (reason.startswith("scylladb/scylladb#") or reason.startswith("scylladb/scylla-enterprise#")):
718+
raise ValueError('reason should start with scylladb/scylladb#<issue-id> or scylladb/scylla-enterprise#<issue-id> to reference issue in scylla repo')
719+
720+
if not isinstance(scylla_version, str):
721+
raise ValueError('scylla_version should be a str')
722+
723+
if SCYLLA_VERSION is None:
724+
return pytest.mark.skipif(False, reason="It is just a NoOP Decor, should not skip anything")
725+
726+
current_version = Version(get_scylla_version(SCYLLA_VERSION))
727+
728+
return pytest.mark.skipif(current_version < Version(scylla_version), reason=reason)
729+
730+
710731
class UpDownWaiter(object):
711732

712733
def __init__(self, host):

0 commit comments

Comments
 (0)