Skip to content

Commit 83dcd61

Browse files
committed
tests: mark test which are scylla specific
those test can't be run ontop of cassandra and we should mark them in a why we can skip them
1 parent 6aa690b commit 83dcd61

8 files changed

+16
-14
lines changed

tests/integration/__init__.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -391,13 +391,14 @@ def _id_and_mark(f):
391391
reason='Scylla does not support custom payloads. Cassandra requires native protocol v4.0+')
392392
xfail_scylla = lambda reason, *args, **kwargs: pytest.mark.xfail(SCYLLA_VERSION is not None, reason=reason, *args, **kwargs)
393393
incorrect_test = lambda reason='This test seems to be incorrect and should be fixed', *args, **kwargs: pytest.mark.xfail(reason=reason, *args, **kwargs)
394+
scylla_only = pytest.mark.skipif(SCYLLA_VERSION is None, reason='Scylla only test')
394395

395396
pypy = unittest.skipUnless(platform.python_implementation() == "PyPy", "Test is skipped unless it's on PyPy")
396397
notpy3 = unittest.skipIf(sys.version_info >= (3, 0), "Test not applicable for Python 3.x runtime")
397398
requiresmallclockgranularity = unittest.skipIf("Windows" in platform.system() or "asyncore" in EVENT_LOOP_MANAGER,
398399
"This test is not suitible for environments with large clock granularity")
399400
requiressimulacron = unittest.skipIf(SIMULACRON_JAR is None or CASSANDRA_VERSION < Version("2.1"), "Simulacron jar hasn't been specified or C* version is 2.0")
400-
requirecassandra = unittest.skipIf(DSE_VERSION, "Cassandra required")
401+
requirecassandra = unittest.skipIf(DSE_VERSION or SCYLLA_VERSION, "Cassandra required")
401402
notdse = unittest.skipIf(DSE_VERSION, "DSE not supported")
402403
requiredse = unittest.skipUnless(DSE_VERSION, "DSE required")
403404
requirescloudproxy = unittest.skipIf(CLOUD_PROXY_PATH is None, "Cloud Proxy path hasn't been specified")

tests/integration/standard/test_custom_protocol_handler.py

-3
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,6 @@ def test_custom_raw_row_results_all_types(self):
121121
self.assertEqual(len(CustomResultMessageTracked.checked_rev_row_set), len(PRIMITIVE_DATATYPES)-1)
122122
cluster.shutdown()
123123

124-
@unittest.expectedFailure
125124
@requirecassandra
126125
@greaterthanorequalcass40
127126
def test_protocol_divergence_v5_fail_by_continuous_paging(self):
@@ -169,7 +168,6 @@ def test_protocol_divergence_v4_fail_by_flag_uses_int(self):
169168
self._protocol_divergence_fail_by_flag_uses_int(ProtocolVersion.V4, uses_int_query_flag=False,
170169
int_flag=True)
171170

172-
@unittest.expectedFailure
173171
@requirecassandra
174172
@greaterthanorequalcass40
175173
def test_protocol_v5_uses_flag_int(self):
@@ -197,7 +195,6 @@ def test_protocol_dsev1_uses_flag_int(self):
197195
self._protocol_divergence_fail_by_flag_uses_int(ProtocolVersion.DSE_V1, uses_int_query_flag=True,
198196
int_flag=True)
199197

200-
@unittest.expectedFailure
201198
@requirecassandra
202199
@greaterthanorequalcass40
203200
def test_protocol_divergence_v5_fail_by_flag_uses_int(self):

tests/integration/standard/test_ip_change.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
from cassandra.cluster import ExecutionProfile
66
from cassandra.policies import WhiteListRoundRobinPolicy
77

8-
from tests.integration import use_cluster, get_node, get_cluster, local, TestCluster
8+
from tests.integration import use_cluster, get_node, get_cluster, local, TestCluster, scylla_only
99
from tests.util import wait_until_not_raised
1010

1111
LOGGER = logging.getLogger(__name__)
@@ -16,6 +16,7 @@ def setup_module():
1616
use_cluster('test_ip_change', [3], start=True)
1717

1818
@local
19+
@scylla_only
1920
class TestIpAddressChange(unittest.TestCase):
2021
@classmethod
2122
def setup_class(cls):

tests/integration/standard/test_metadata.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
import pytest
2727

2828
from cassandra import AlreadyExists, SignatureDescriptor, UserFunctionDescriptor, UserAggregateDescriptor
29-
29+
from ccmlib.scylla_cluster import ScyllaCluster
3030
from cassandra.encoder import Encoder
3131
from cassandra.metadata import (IndexMetadata, Token, murmur3, Function, Aggregate, protect_name, protect_names,
3232
RegisteredTableExtension, _RegisteredExtensionType, get_schema_parser,
@@ -1205,7 +1205,7 @@ def test_export_keyspace_schema_udts(self):
12051205
cluster.shutdown()
12061206

12071207
@greaterthancass21
1208-
@pytest.mark.xfail(reason='Column name in CREATE INDEX is not quoted. It\'s a bug in driver or in Scylla')
1208+
@xfail_scylla(reason='Column name in CREATE INDEX is not quoted. It\'s a bug in driver or in Scylla')
12091209
def test_case_sensitivity(self):
12101210
"""
12111211
Test that names that need to be escaped in CREATE statements are
@@ -1275,13 +1275,13 @@ def test_already_exists_exceptions(self):
12751275
cluster.shutdown()
12761276

12771277
@local
1278-
@pytest.mark.xfail(reason='AssertionError: \'RAC1\' != \'r1\' - probably a bug in driver or in Scylla')
12791278
def test_replicas(self):
12801279
"""
12811280
Ensure cluster.metadata.get_replicas return correctly when not attached to keyspace
12821281
"""
12831282
if murmur3 is None:
12841283
raise unittest.SkipTest('the murmur3 extension is not available')
1284+
is_scylla = isinstance(get_cluster(), ScyllaCluster)
12851285

12861286
cluster = TestCluster()
12871287
self.assertEqual(cluster.metadata.get_replicas('test3rf', 'key'), [])
@@ -1291,7 +1291,7 @@ def test_replicas(self):
12911291
self.assertNotEqual(list(cluster.metadata.get_replicas('test3rf', six.b('key'))), [])
12921292
host = list(cluster.metadata.get_replicas('test3rf', six.b('key')))[0]
12931293
self.assertEqual(host.datacenter, 'dc1')
1294-
self.assertEqual(host.rack, 'r1')
1294+
self.assertEqual(host.rack, 'RAC1' if is_scylla else 'r1')
12951295
cluster.shutdown()
12961296

12971297
def test_token_map(self):

tests/integration/standard/test_rate_limit_exceeded.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,14 @@
44
from cassandra.cluster import Cluster
55
from cassandra.policies import ConstantReconnectionPolicy, RoundRobinPolicy, TokenAwarePolicy
66

7-
from tests.integration import PROTOCOL_VERSION, use_cluster
7+
from tests.integration import PROTOCOL_VERSION, use_cluster, scylla_only
88

99
LOGGER = logging.getLogger(__name__)
1010

1111
def setup_module():
1212
use_cluster('rate_limit', [3], start=True)
1313

14+
@scylla_only
1415
class TestRateLimitExceededException(unittest.TestCase):
1516
@classmethod
1617
def setup_class(cls):

tests/integration/standard/test_scylla_cloud.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
from ccmlib.utils.ssl_utils import generate_ssl_stores
55
from ccmlib.utils.sni_proxy import refresh_certs, get_cluster_info, start_sni_proxy, create_cloud_config
66

7-
from tests.integration import use_cluster
7+
from tests.integration import use_cluster, scylla_only
88
from cassandra.cluster import Cluster, TwistedConnection
99

1010

@@ -23,7 +23,7 @@
2323
# need to run them with specific configuration like `gevent.monkey.patch_all()` or under async functions
2424
# unsupported_connection_classes = [GeventConnection, AsyncioConnection, EventletConnection]
2525

26-
26+
@scylla_only
2727
class ScyllaCloudConfigTests(TestCase):
2828
def start_cluster_with_proxy(self):
2929
ccm_cluster = self.ccm_cluster

tests/integration/standard/test_shard_aware.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
from cassandra.policies import TokenAwarePolicy, RoundRobinPolicy, ConstantReconnectionPolicy
3333
from cassandra import OperationTimedOut, ConsistencyLevel
3434

35-
from tests.integration import use_cluster, get_node, PROTOCOL_VERSION
35+
from tests.integration import use_cluster, get_node, PROTOCOL_VERSION, scylla_only
3636

3737
LOGGER = logging.getLogger(__name__)
3838

@@ -42,6 +42,7 @@ def setup_module():
4242
use_cluster('shard_aware', [3], start=True)
4343

4444

45+
@scylla_only
4546
class TestShardAwareIntegration(unittest.TestCase):
4647
@classmethod
4748
def setup_class(cls):

tests/integration/standard/test_types.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131

3232
from tests.integration import use_singledc, execute_until_pass, notprotocolv1, \
3333
BasicSharedKeyspaceUnitTestCase, greaterthancass21, lessthancass30, greaterthanorequaldse51, \
34-
DSE_VERSION, greaterthanorequalcass3_10, requiredse, TestCluster, requires_composite_type
34+
DSE_VERSION, greaterthanorequalcass3_10, requiredse, TestCluster, requires_composite_type, scylla_only
3535
from tests.integration.datatype_utils import update_datatypes, PRIMITIVE_DATATYPES, COLLECTION_TYPES, PRIMITIVE_DATATYPES_KEYS, \
3636
get_sample, get_all_samples, get_collection_sample
3737

@@ -723,6 +723,7 @@ def test_can_insert_tuples_with_nulls(self):
723723
self.assertEqual(('', None, None, b''), result[0].t)
724724
self.assertEqual(('', None, None, b''), s.execute(read)[0].t)
725725

726+
@scylla_only
726727
def test_insert_collection_with_null_fails(self):
727728
"""
728729
NULLs in list / sets / maps are forbidden.

0 commit comments

Comments
 (0)