Skip to content

Commit 6b82872

Browse files
authored
Merge pull request #282 from fruch/fix_scylla_version_handling
tests: fix scylla_version handling
2 parents 7608a51 + 6a88ac4 commit 6b82872

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

Diff for: tests/integration/__init__.py

+9-3
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@
4343
from cassandra import ProtocolVersion
4444

4545
try:
46+
import ccmlib
4647
from ccmlib.dse_cluster import DseCluster
4748
from ccmlib.cluster import Cluster as CCMCluster
4849
from ccmlib.scylla_cluster import ScyllaCluster as CCMScyllaCluster
@@ -97,6 +98,12 @@ def get_server_versions():
9798
return (cass_version, cql_version)
9899

99100

101+
def get_scylla_version(scylla_ccm_version_string):
102+
""" get scylla version from ccm before starting a cluster"""
103+
ccm_repo_cache_dir, _ = ccmlib.scylla_repository.setup(version=scylla_ccm_version_string)
104+
return ccmlib.common.get_version_from_build(ccm_repo_cache_dir)
105+
106+
100107
def _tuple_version(version_string):
101108
if '-' in version_string:
102109
version_string = version_string[:version_string.index('-')]
@@ -372,9 +379,8 @@ def _id_and_mark(f):
372379
# 1. unittest doesn't skip setUpClass when used on class and we need it sometimes
373380
# 2. unittest doesn't have conditional xfail, and I prefer to use pytest than custom decorator
374381
# 3. unittest doesn't have a reason argument, so you don't see the reason in pytest report
375-
# TODO remove second check when we stop using unstable version in CI for tablets
376-
requires_collection_indexes = pytest.mark.skipif(SCYLLA_VERSION is not None and (len(SCYLLA_VERSION.split('/')) != 0 or Version(SCYLLA_VERSION.split(':')[1]) < Version('5.2')),
377-
reason='Scylla supports collection indexes from 5.2 onwards')
382+
requires_collection_indexes = pytest.mark.skipif(SCYLLA_VERSION is not None and Version(get_scylla_version(SCYLLA_VERSION)) < Version('5.2'),
383+
reason='Scylla supports collection indexes from 5.2 onwards')
378384
requires_custom_indexes = pytest.mark.skipif(SCYLLA_VERSION is not None,
379385
reason='Scylla does not support SASI or any other CUSTOM INDEX class')
380386
requires_java_udf = pytest.mark.skipif(SCYLLA_VERSION is not None,

0 commit comments

Comments
 (0)