@@ -819,6 +819,38 @@ def setup_keyspace(ipformat=None, wait=True, protocol_version=None, port=9042):
819819 cluster .shutdown ()
820820
821821
822+ def is_scylla_enterprise (version : Version ) -> bool :
823+ return version > Version ('2000.1.1' )
824+
825+
826+ def xfail_scylla_version_lt (reason , oss_scylla_version , ent_scylla_version , * args , ** kwargs ):
827+ """
828+ It is used to mark tests that are going to fail on certain scylla versions.
829+ :param reason: message to fail test with
830+ :param oss_scylla_version: str, oss version from which test supposed to succeed
831+ :param ent_scylla_version: str, enterprise version from which test supposed to succeed. It should end with `.1.1`
832+ """
833+ if not reason .startswith ("scylladb/scylladb#" ):
834+ raise ValueError ('reason should start with scylladb/scylladb#<issue-id> to reference issue in scylla repo' )
835+
836+ if not isinstance (ent_scylla_version , str ):
837+ raise ValueError ('ent_scylla_version should be a str' )
838+
839+ if not ent_scylla_version .endswith ("1.1" ):
840+ raise ValueError ('ent_scylla_version should end with "1.1"' )
841+
842+ if SCYLLA_VERSION is None :
843+ return pytest .mark .skipif (False , reason = "It is just a NoOP Decor, should not skip anything" )
844+
845+ current_version = Version (get_scylla_version (SCYLLA_VERSION ))
846+
847+ if is_scylla_enterprise (current_version ):
848+ return pytest .mark .xfail (current_version < Version (ent_scylla_version ),
849+ reason = reason , * args , ** kwargs )
850+
851+ return pytest .mark .xfail (current_version < Version (oss_scylla_version ), reason = reason , * args , ** kwargs )
852+
853+
822854class UpDownWaiter (object ):
823855
824856 def __init__ (self , host ):
0 commit comments