Skip to content

Commit 8483fa0

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

File tree

6 files changed

+41
-6
lines changed

6 files changed

+41
-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: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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+
822854
class UpDownWaiter(object):
823855

824856
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)