Skip to content

Commit 8bba6eb

Browse files
sylwiaszunejkodkropachev
authored andcommitted
Introduce skip_scylla_version_lt for integration tests
1 parent 9aa5ddc commit 8bba6eb

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
@@ -715,6 +715,27 @@ def xfail_scylla_version_lt(reason, oss_scylla_version, ent_scylla_version, *arg
715715

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

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

720741
def __init__(self, host):

0 commit comments

Comments
 (0)