diff --git a/tests/integration/__init__.py b/tests/integration/__init__.py index e728bc7740..7d1b0ab063 100644 --- a/tests/integration/__init__.py +++ b/tests/integration/__init__.py @@ -43,6 +43,7 @@ from cassandra import ProtocolVersion try: + import ccmlib from ccmlib.dse_cluster import DseCluster from ccmlib.cluster import Cluster as CCMCluster from ccmlib.scylla_cluster import ScyllaCluster as CCMScyllaCluster @@ -97,6 +98,12 @@ def get_server_versions(): return (cass_version, cql_version) +def get_scylla_version(scylla_ccm_version_string): + """ get scylla version from ccm before starting a cluster""" + ccm_repo_cache_dir, _ = ccmlib.scylla_repository.setup(version=scylla_ccm_version_string) + return ccmlib.common.get_version_from_build(ccm_repo_cache_dir) + + def _tuple_version(version_string): if '-' in version_string: version_string = version_string[:version_string.index('-')] @@ -372,7 +379,7 @@ def _id_and_mark(f): # 1. unittest doesn't skip setUpClass when used on class and we need it sometimes # 2. unittest doesn't have conditional xfail, and I prefer to use pytest than custom decorator # 3. unittest doesn't have a reason argument, so you don't see the reason in pytest report -requires_collection_indexes = pytest.mark.skipif(SCYLLA_VERSION is not None and Version(SCYLLA_VERSION.split(':')[1]) < Version('5.2'), +requires_collection_indexes = pytest.mark.skipif(SCYLLA_VERSION is not None and Version(get_scylla_version(SCYLLA_VERSION)) < Version('5.2'), reason='Scylla supports collection indexes from 5.2 onwards') requires_custom_indexes = pytest.mark.skipif(SCYLLA_VERSION is not None, reason='Scylla does not support SASI or any other CUSTOM INDEX class')