Skip to content

Commit 99a37c9

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 b957c0f commit 99a37c9

8 files changed

+17
-15
lines changed

tests/integration/__init__.py

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

394395
pypy = unittest.skipUnless(platform.python_implementation() == "PyPy", "Test is skipped unless it's on PyPy")
395396
requiresmallclockgranularity = unittest.skipIf("Windows" in platform.system() or "asyncore" in EVENT_LOOP_MANAGER,
396397
"This test is not suitible for environments with large clock granularity")
397398
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")
398-
requirecassandra = unittest.skipIf(DSE_VERSION, "Cassandra required")
399+
requirecassandra = unittest.skipIf(DSE_VERSION or SCYLLA_VERSION, "Cassandra required")
399400
notdse = unittest.skipIf(DSE_VERSION, "DSE not supported")
400401
requiredse = unittest.skipUnless(DSE_VERSION, "DSE required")
401402
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
@@ -120,7 +120,6 @@ def test_custom_raw_row_results_all_types(self):
120120
self.assertEqual(len(CustomResultMessageTracked.checked_rev_row_set), len(PRIMITIVE_DATATYPES)-1)
121121
cluster.shutdown()
122122

123-
@unittest.expectedFailure
124123
@requirecassandra
125124
@greaterthanorequalcass40
126125
def test_protocol_divergence_v5_fail_by_continuous_paging(self):
@@ -168,7 +167,6 @@ def test_protocol_divergence_v4_fail_by_flag_uses_int(self):
168167
self._protocol_divergence_fail_by_flag_uses_int(ProtocolVersion.V4, uses_int_query_flag=False,
169168
int_flag=True)
170169

171-
@unittest.expectedFailure
172170
@requirecassandra
173171
@greaterthanorequalcass40
174172
def test_protocol_v5_uses_flag_int(self):
@@ -196,7 +194,6 @@ def test_protocol_dsev1_uses_flag_int(self):
196194
self._protocol_divergence_fail_by_flag_uses_int(ProtocolVersion.DSE_V1, uses_int_query_flag=True,
197195
int_flag=True)
198196

199-
@unittest.expectedFailure
200197
@requirecassandra
201198
@greaterthanorequalcass40
202199
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

+5-5
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,13 @@
2626

2727
from cassandra import AlreadyExists, SignatureDescriptor, UserFunctionDescriptor, UserAggregateDescriptor
2828
from cassandra.connection import Connection
29-
3029
from cassandra.encoder import Encoder
3130
from cassandra.metadata import (IndexMetadata, Token, murmur3, Function, Aggregate, protect_name, protect_names,
3231
RegisteredTableExtension, _RegisteredExtensionType, get_schema_parser,
3332
group_keys_by_replica, NO_VALID_REPLICA)
3433
from cassandra.protocol import QueryMessage, ProtocolHandler
3534
from cassandra.util import SortedSet
35+
from ccmlib.scylla_cluster import ScyllaCluster
3636

3737
from tests.integration import (get_cluster, use_singledc, PROTOCOL_VERSION, execute_until_pass,
3838
BasicSegregatedKeyspaceUnitTestCase, BasicSharedKeyspaceUnitTestCase,
@@ -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

@@ -1207,7 +1207,7 @@ def test_export_keyspace_schema_udts(self):
12071207
cluster.shutdown()
12081208

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

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

12881288
cluster = TestCluster()
12891289
self.assertEqual(cluster.metadata.get_replicas('test3rf', 'key'), [])
@@ -1293,7 +1293,7 @@ def test_replicas(self):
12931293
self.assertNotEqual(list(cluster.metadata.get_replicas('test3rf', b'key')), [])
12941294
host = list(cluster.metadata.get_replicas('test3rf', b'key'))[0]
12951295
self.assertEqual(host.datacenter, 'dc1')
1296-
self.assertEqual(host.rack, 'r1')
1296+
self.assertEqual(host.rack, 'RAC1' if is_scylla else 'r1')
12971297
cluster.shutdown()
12981298

12991299
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

@@ -704,6 +704,7 @@ def test_can_insert_tuples_with_nulls(self):
704704
self.assertEqual(('', None, None, b''), result[0].t)
705705
self.assertEqual(('', None, None, b''), s.execute(read)[0].t)
706706

707+
@scylla_only
707708
def test_insert_collection_with_null_fails(self):
708709
"""
709710
NULLs in list / sets / maps are forbidden.

0 commit comments

Comments
 (0)