Skip to content

Commit d655cb6

Browse files
committed
Switch to scylla 6.2
1 parent 347f332 commit d655cb6

File tree

6 files changed

+45
-6
lines changed

6 files changed

+45
-6
lines changed

.github/workflows/integration-tests.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,11 @@ jobs:
4040
- name: Test with pytest
4141
run: |
4242
export EVENT_LOOP_MANAGER=${{ matrix.event_loop_manager }}
43-
export SCYLLA_VERSION='release:5.1'
43+
export SCYLLA_VERSION='release:6.2'
4444
./scripts/run_integration_test.sh tests/integration/standard/ tests/integration/cqlengine/
4545
4646
- name: Test tablets
4747
run: |
4848
export EVENT_LOOP_MANAGER=${{ matrix.event_loop_manager }}
49-
export SCYLLA_VERSION='release:6.0.2'
49+
export SCYLLA_VERSION='release:6.2'
5050
./scripts/run_integration_test.sh tests/integration/experiments/

cassandra/cqlengine/management.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ def _get_index_name_by_column(table, column_name):
153153
Find the index name for a given table and column.
154154
"""
155155
protected_name = metadata.protect_name(column_name)
156-
possible_index_values = [protected_name, "values(%s)" % protected_name]
156+
possible_index_values = [protected_name, "values(%s)" % protected_name, "keys(%s)" % protected_name]
157157
for index_metadata in table.indexes.values():
158158
options = dict(index_metadata.index_options)
159159
if options.get('target') in possible_index_values:

tests/integration/__init__.py

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -299,6 +299,8 @@ def get_unsupported_lower_protocol():
299299
This is used to determine the lowest protocol version that is NOT
300300
supported by the version of C* running
301301
"""
302+
if SCYLLA_VERSION is not None:
303+
return 2
302304
if CASSANDRA_VERSION >= Version('3.0'):
303305
return 2
304306
else:
@@ -310,6 +312,8 @@ def get_unsupported_upper_protocol():
310312
This is used to determine the highest protocol version that is NOT
311313
supported by the version of C* running
312314
"""
315+
if SCYLLA_VERSION is not None:
316+
return 5
313317

314318
if CASSANDRA_VERSION >= Version('4.0-a'):
315319
if DSE_VERSION:
@@ -819,6 +823,38 @@ def setup_keyspace(ipformat=None, wait=True, protocol_version=None, port=9042):
819823
cluster.shutdown()
820824

821825

826+
def is_scylla_enterprise(version: Version) -> bool:
827+
return version > Version('2000.1.1')
828+
829+
830+
def xfail_scylla_version_lt(reason, oss_scylla_version, ent_scylla_version, *args, **kwargs):
831+
"""
832+
It is used to mark tests that are going to fail on certain scylla versions.
833+
:param reason: message to fail test with
834+
:param oss_scylla_version: str, oss version from which test supposed to succeed
835+
:param ent_scylla_version: str, enterprise version from which test supposed to succeed. It should end with `.1.1`
836+
"""
837+
if not reason.startswith("scylladb/scylladb#"):
838+
raise ValueError('reason should start with scylladb/scylladb#<issue-id> to reference issue in scylla repo')
839+
840+
if not isinstance(ent_scylla_version, str):
841+
raise ValueError('ent_scylla_version should be a str')
842+
843+
if not ent_scylla_version.endswith("1.1"):
844+
raise ValueError('ent_scylla_version should end with "1.1"')
845+
846+
if SCYLLA_VERSION is None:
847+
return pytest.mark.skipif(False, reason="It is just a NoOP Decor, should not skip anything")
848+
849+
current_version = Version(get_scylla_version(SCYLLA_VERSION))
850+
851+
if is_scylla_enterprise(current_version):
852+
return pytest.mark.xfail(current_version < Version(ent_scylla_version),
853+
reason=reason, *args, **kwargs)
854+
855+
return pytest.mark.xfail(current_version < Version(oss_scylla_version), reason=reason, *args, **kwargs)
856+
857+
822858
class UpDownWaiter(object):
823859

824860
def __init__(self, host):

tests/integration/cqlengine/management/test_compaction_settings.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ class SizeTieredCompactionChangesDetectionTest(Model):
6060

6161
__options__ = {'compaction': {'class': 'org.apache.cassandra.db.compaction.SizeTieredCompactionStrategy',
6262
'bucket_high': '20',
63-
'bucket_low': '10',
63+
'bucket_low': '0.5',
6464
'max_threshold': '200',
6565
'min_threshold': '100',
6666
'min_sstable_size': '1000',

tests/integration/cqlengine/query/test_queryset.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
from cassandra.util import uuid_from_time
4040
from cassandra.cqlengine.connection import get_session
4141
from tests.integration import PROTOCOL_VERSION, CASSANDRA_VERSION, greaterthancass20, greaterthancass21, \
42-
greaterthanorequalcass30, TestCluster, requires_collection_indexes
42+
greaterthanorequalcass30, TestCluster, requires_collection_indexes, xfail_scylla
4343
from tests.integration.cqlengine import execute_count, DEFAULT_KEYSPACE
4444

4545

@@ -602,6 +602,8 @@ def test_distinct_with_explicit_count(self):
602602
@requires_collection_indexes
603603
class TestQuerySetOrdering(BaseQuerySetUsage):
604604
@execute_count(2)
605+
@xfail_scylla(
606+
reason="Scylla does not support ordering on non-primary key columns: https://github.com/scylladb/python-driver/issues/343")
605607
def test_order_by_success_case(self):
606608
q = TestModel.objects(test_id=0).order_by('attempt_id')
607609
expected_order = [0, 1, 2, 3]

tests/integration/standard/test_metadata.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
greaterthancass21, assert_startswith, greaterthanorequalcass40,
4343
greaterthanorequaldse67, lessthancass40,
4444
TestCluster, DSE_VERSION, requires_java_udf, requires_composite_type,
45-
requires_collection_indexes, SCYLLA_VERSION)
45+
requires_collection_indexes, SCYLLA_VERSION, xfail_scylla)
4646

4747
from tests.util import wait_until
4848

@@ -505,6 +505,7 @@ def test_indexes(self):
505505

506506
@greaterthancass21
507507
@requires_collection_indexes
508+
@xfail_scylla('scylladb/scylladb#22013 - scylla does not show full index in system_schema.indexes')
508509
def test_collection_indexes(self):
509510

510511
self.session.execute("CREATE TABLE %s.%s (a int PRIMARY KEY, b map<text, text>)"

0 commit comments

Comments
 (0)