Skip to content

Switch to scylla 6.2 #397

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Dec 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/integration-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,11 @@ jobs:
- name: Test with pytest
run: |
export EVENT_LOOP_MANAGER=${{ matrix.event_loop_manager }}
export SCYLLA_VERSION='release:5.1'
export SCYLLA_VERSION='release:6.2'
./scripts/run_integration_test.sh tests/integration/standard/ tests/integration/cqlengine/

- name: Test tablets
run: |
export EVENT_LOOP_MANAGER=${{ matrix.event_loop_manager }}
export SCYLLA_VERSION='release:6.0.2'
export SCYLLA_VERSION='release:6.2'
./scripts/run_integration_test.sh tests/integration/experiments/
36 changes: 36 additions & 0 deletions tests/integration/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,8 @@ def get_unsupported_lower_protocol():
This is used to determine the lowest protocol version that is NOT
supported by the version of C* running
"""
if SCYLLA_VERSION is not None:
return 2
if CASSANDRA_VERSION >= Version('3.0'):
return 2
else:
Expand All @@ -310,6 +312,8 @@ def get_unsupported_upper_protocol():
This is used to determine the highest protocol version that is NOT
supported by the version of C* running
"""
if SCYLLA_VERSION is not None:
return 5

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


def is_scylla_enterprise(version: Version) -> bool:
return version > Version('2000.1.1')


def xfail_scylla_version_lt(reason, oss_scylla_version, ent_scylla_version, *args, **kwargs):
"""
It is used to mark tests that are going to fail on certain scylla versions.
:param reason: message to fail test with
:param oss_scylla_version: str, oss version from which test supposed to succeed
:param ent_scylla_version: str, enterprise version from which test supposed to succeed. It should end with `.1.1`
"""
if not reason.startswith("scylladb/scylladb#"):
raise ValueError('reason should start with scylladb/scylladb#<issue-id> to reference issue in scylla repo')

if not isinstance(ent_scylla_version, str):
raise ValueError('ent_scylla_version should be a str')

if not ent_scylla_version.endswith("1.1"):
raise ValueError('ent_scylla_version should end with "1.1"')

if SCYLLA_VERSION is None:
return pytest.mark.skipif(False, reason="It is just a NoOP Decor, should not skip anything")

current_version = Version(get_scylla_version(SCYLLA_VERSION))

if is_scylla_enterprise(current_version):
return pytest.mark.xfail(current_version < Version(ent_scylla_version),
reason=reason, *args, **kwargs)

return pytest.mark.xfail(current_version < Version(oss_scylla_version), reason=reason, *args, **kwargs)


class UpDownWaiter(object):

def __init__(self, host):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ class SizeTieredCompactionChangesDetectionTest(Model):

__options__ = {'compaction': {'class': 'org.apache.cassandra.db.compaction.SizeTieredCompactionStrategy',
'bucket_high': '20',
'bucket_low': '10',
'bucket_low': '0.5',
'max_threshold': '200',
'min_threshold': '100',
'min_sstable_size': '1000',
Expand Down
6 changes: 4 additions & 2 deletions tests/integration/cqlengine/management/test_management.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,15 @@
from cassandra.cqlengine.models import Model
from cassandra.cqlengine import columns

from tests.integration import DSE_VERSION, PROTOCOL_VERSION, greaterthancass20, requires_collection_indexes, MockLoggingHandler, CASSANDRA_VERSION
from tests.integration import DSE_VERSION, PROTOCOL_VERSION, greaterthancass20, requires_collection_indexes, \
MockLoggingHandler, CASSANDRA_VERSION, SCYLLA_VERSION, xfail_scylla
from tests.integration.cqlengine.base import BaseCassEngTestCase
from tests.integration.cqlengine.query.test_queryset import TestModel
from cassandra.cqlengine.usertype import UserType
from tests.integration.cqlengine import DEFAULT_KEYSPACE


INCLUDE_REPAIR = not CASSANDRA_VERSION >= Version('4-a') # This should cover DSE 6.0+
INCLUDE_REPAIR = (not CASSANDRA_VERSION >= Version('4-a')) and SCYLLA_VERSION is None # This should cover DSE 6.0+


class KeyspaceManagementTest(BaseCassEngTestCase):
Expand Down Expand Up @@ -429,6 +430,7 @@ def test_sync_index_case_sensitive(self):

@greaterthancass20
@requires_collection_indexes
@xfail_scylla("scylladb/scylladb#22019 - Scylla incorrectly reports target as keys(%s) for sets")
def test_sync_indexed_set(self):
"""
Tests that models that have container types with indices can be synced.
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/cqlengine/query/test_queryset.py
Original file line number Diff line number Diff line change
Expand Up @@ -608,7 +608,7 @@ def test_order_by_success_case(self):
for model, expect in zip(q, expected_order):
assert model.attempt_id == expect

q = q.order_by('-attempt_id')
q = q.order_by().order_by('-attempt_id')
expected_order.reverse()
for model, expect in zip(q, expected_order):
assert model.attempt_id == expect
Expand Down
1 change: 0 additions & 1 deletion tests/integration/standard/test_cluster.py
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,6 @@ def test_protocol_negotiation(self):

cluster.shutdown()

@xfail_scylla("Failing with scylla because there is option to create a cluster with 'lower bound' protocol")
def test_invalid_protocol_negotation(self):
"""
Test for protocol negotiation when explicit versions are set
Expand Down
6 changes: 4 additions & 2 deletions tests/integration/standard/test_metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
greaterthancass21, assert_startswith, greaterthanorequalcass40,
greaterthanorequaldse67, lessthancass40,
TestCluster, DSE_VERSION, requires_java_udf, requires_composite_type,
requires_collection_indexes, SCYLLA_VERSION)
requires_collection_indexes, SCYLLA_VERSION, xfail_scylla, xfail_scylla_version_lt)

from tests.util import wait_until

Expand Down Expand Up @@ -505,6 +505,7 @@ def test_indexes(self):

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

self.session.execute("CREATE TABLE %s.%s (a int PRIMARY KEY, b map<text, text>)"
Expand Down Expand Up @@ -1207,7 +1208,8 @@ def test_export_keyspace_schema_udts(self):
cluster.shutdown()

@greaterthancass21
@pytest.mark.xfail(reason='Column name in CREATE INDEX is not quoted. It\'s a bug in driver or in Scylla')
@xfail_scylla_version_lt(reason='scylladb/scylladb#10707 - Column name in CREATE INDEX is not quoted',
oss_scylla_version="5.2", ent_scylla_version="2023.1.1")
def test_case_sensitivity(self):
"""
Test that names that need to be escaped in CREATE statements are
Expand Down
Loading