Skip to content

Commit 6e12577

Browse files
committed
test: drop USE_CASS_EXTERNAL integration mode
1 parent 8f772c8 commit 6e12577

7 files changed

Lines changed: 26 additions & 57 deletions

File tree

CONTRIBUTING.rst

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -93,12 +93,6 @@ Or you can specify a scylla/cassandra directory (to test unreleased versions)::
9393

9494
SCYLLA_VERSION=/path/to/scylla uv run pytest tests/integration/standard/
9595

96-
Specifying the usage of an already running Scylla cluster
97-
------------------------------------------------------------
98-
The test will start the appropriate Scylla clusters when necessary but if you don't want this to happen because a Scylla cluster is already running the flag ``USE_CASS_EXTERNAL`` can be used, for example::
99-
100-
USE_CASS_EXTERNAL=1 SCYLLA_VERSION='release:5.1' uv run pytest tests/integration/standard
101-
10296
Specify a Protocol Version for Tests
10397
------------------------------------
10498
The protocol version defaults to:

tests/integration/__init__.py

Lines changed: 3 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,6 @@ def cmd_line_args_to_dict(env_var):
122122
args[cmd_arg.lstrip('-')] = cmd_arg_value
123123
return args
124124

125-
USE_CASS_EXTERNAL = bool(os.getenv('USE_CASS_EXTERNAL', False))
126125
KEEP_TEST_CLUSTER = bool(os.getenv('KEEP_TEST_CLUSTER', False))
127126
SIMULACRON_JAR = os.getenv('SIMULACRON_JAR', None)
128127

@@ -250,7 +249,7 @@ def get_unsupported_upper_protocol():
250249

251250

252251
def local_decorator_creator():
253-
if USE_CASS_EXTERNAL or not CASSANDRA_IP.startswith("127.0.0."):
252+
if not CASSANDRA_IP.startswith("127.0.0."):
254253
return unittest.skip('Tests only runs against local C*')
255254

256255
def _id_and_mark(f):
@@ -373,7 +372,7 @@ def check_log_error():
373372

374373

375374
def remove_cluster():
376-
if USE_CASS_EXTERNAL or KEEP_TEST_CLUSTER:
375+
if KEEP_TEST_CLUSTER:
377376
return
378377

379378
global CCM_CLUSTER
@@ -430,21 +429,6 @@ def use_cluster(cluster_name, nodes, ipformat=None, start=True, workloads=None,
430429
cassandra_version = ccm_options.get('version', CCM_VERSION)
431430

432431
global CCM_CLUSTER
433-
if USE_CASS_EXTERNAL:
434-
if CCM_CLUSTER:
435-
log.debug("Using external CCM cluster {0}".format(CCM_CLUSTER.name))
436-
else:
437-
ccm_path = os.getenv("CCM_PATH", None)
438-
ccm_name = os.getenv("CCM_NAME", None)
439-
if ccm_path and ccm_name:
440-
CCM_CLUSTER = CCMClusterFactory.load(ccm_path, ccm_name)
441-
log.debug("Using external CCM cluster {0}".format(CCM_CLUSTER.name))
442-
else:
443-
log.debug("Using unnamed external cluster")
444-
if set_keyspace and start:
445-
setup_keyspace(ipformat=ipformat)
446-
return
447-
448432
if is_current_cluster(cluster_name, nodes, workloads):
449433
log.debug("Using existing cluster, matching topology: {0}".format(cluster_name))
450434
else:
@@ -549,7 +533,7 @@ def use_cluster(cluster_name, nodes, ipformat=None, start=True, workloads=None,
549533

550534

551535
def teardown_package():
552-
if USE_CASS_EXTERNAL or KEEP_TEST_CLUSTER:
536+
if KEEP_TEST_CLUSTER:
553537
return
554538
# when multiple modules are run explicitly, this runs between them
555539
# need to make sure CCM_CLUSTER is properly cleared for that case

tests/integration/conftest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ def cleanup_clusters():
2020
'cluster_tests', 'shared_aware', 'sni_proxy', 'test_ip_change', 'test_client_routes_replacement']:
2121
try:
2222
cluster = CCMClusterFactory.load(ccm_path, cluster_name)
23-
logging.debug("Using external CCM cluster {0}".format(cluster.name))
23+
logging.debug("Clearing CCM cluster {0}".format(cluster.name))
2424
cluster.clear()
2525
except FileNotFoundError:
2626
pass

tests/integration/standard/test_authentication.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
from cassandra.auth import PlainTextAuthProvider, SASLClient, SaslAuthProvider
2323

2424
from tests.integration import use_singledc, get_cluster, remove_cluster, PROTOCOL_VERSION, \
25-
CASSANDRA_IP, CASSANDRA_VERSION, USE_CASS_EXTERNAL, start_cluster_wait_for_up, TestCluster
25+
CASSANDRA_IP, CASSANDRA_VERSION, start_cluster_wait_for_up, TestCluster
2626
from tests.integration.util import assert_quiescent_pool_state
2727

2828
import unittest
@@ -40,7 +40,7 @@
4040
def setup_module():
4141
global _saved_scylla_ext_opts
4242
_saved_scylla_ext_opts = os.environ.get('SCYLLA_EXT_OPTS')
43-
if CASSANDRA_IP.startswith("127.0.0.") and not USE_CASS_EXTERNAL:
43+
if CASSANDRA_IP.startswith("127.0.0."):
4444
use_singledc(start=False)
4545
ccm_cluster = get_cluster()
4646
ccm_cluster.stop()

tests/integration/standard/test_authentication_misconfiguration.py

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
import unittest
1616
import pytest
1717

18-
from tests.integration import USE_CASS_EXTERNAL, use_cluster, TestCluster
18+
from tests.integration import use_cluster, TestCluster
1919

2020

2121
@pytest.mark.skip(reason="Flaky test - needs investigation whether its Scylla's or driver's fault."
@@ -24,16 +24,15 @@ class MisconfiguredAuthenticationTests(unittest.TestCase):
2424
""" One node (not the contact point) has password auth. The rest of the nodes have no auth """
2525
@classmethod
2626
def setUpClass(cls):
27-
if not USE_CASS_EXTERNAL:
28-
ccm_cluster = use_cluster(cls.__name__, [3], start=False)
29-
node3 = ccm_cluster.nodes['node3']
30-
node3.set_configuration_options(values={
31-
'authenticator': 'PasswordAuthenticator',
32-
'authorizer': 'CassandraAuthorizer',
33-
})
34-
ccm_cluster.start(wait_for_binary_proto=True, wait_other_notice=True)
27+
ccm_cluster = use_cluster(cls.__name__, [3], start=False)
28+
node3 = ccm_cluster.nodes['node3']
29+
node3.set_configuration_options(values={
30+
'authenticator': 'PasswordAuthenticator',
31+
'authorizer': 'CassandraAuthorizer',
32+
})
33+
ccm_cluster.start(wait_for_binary_proto=True, wait_other_notice=True)
3534

36-
cls.ccm_cluster = ccm_cluster
35+
cls.ccm_cluster = ccm_cluster
3736

3837
def test_connect_no_auth_provider(self):
3938
cluster = TestCluster()
@@ -45,5 +44,4 @@ def test_connect_no_auth_provider(self):
4544

4645
@classmethod
4746
def tearDownClass(cls):
48-
if not USE_CASS_EXTERNAL:
49-
cls.ccm_cluster.stop()
47+
cls.ccm_cluster.stop()

tests/integration/standard/test_control_connection_query_fallback.py

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,17 +18,14 @@
1818

1919
from cassandra.cluster import ControlConnectionQueryFallback, NoHostAvailable
2020

21-
from tests.integration import USE_CASS_EXTERNAL, TestCluster, local, remove_cluster, use_cluster
21+
from tests.integration import TestCluster, local, remove_cluster, use_cluster
2222

2323

2424
_CLUSTER_NAME = "control_connection_query_fallback"
2525
_UNREACHABLE_BROADCAST_RPC_ADDRESS = "127.255.255.1"
2626

2727

2828
def setup_module():
29-
if USE_CASS_EXTERNAL:
30-
return
31-
3229
remove_cluster()
3330

3431
ccm_cluster = use_cluster(_CLUSTER_NAME, [1], start=False)
@@ -39,9 +36,6 @@ def setup_module():
3936

4037

4138
def teardown_module():
42-
if USE_CASS_EXTERNAL:
43-
return
44-
4539
remove_cluster()
4640

4741

tests/integration/standard/test_query.py

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
from cassandra.policies import RoundRobinPolicy, WhiteListRoundRobinPolicy
2727
from tests.integration import use_singledc, PROTOCOL_VERSION, BasicSharedKeyspaceUnitTestCase, \
2828
greaterthanprotocolv3, MockLoggingHandler, get_supported_protocol_versions, local, get_cluster, setup_keyspace, \
29-
USE_CASS_EXTERNAL, greaterthanorequalcass40, TestCluster, xfail_scylla, xfail_scylla_version_lt, \
29+
greaterthanorequalcass40, TestCluster, xfail_scylla, xfail_scylla_version_lt, \
3030
get_tablets_disabled_ddl_suffix, execute_with_long_wait_retry
3131
from tests import notwindows
3232
from tests.integration import greaterthanorequalcass30, get_node
@@ -43,15 +43,14 @@
4343

4444

4545
def setup_module():
46-
if not USE_CASS_EXTERNAL:
47-
use_singledc(start=False)
48-
ccm_cluster = get_cluster()
49-
ccm_cluster.stop()
50-
# This is necessary because test_too_many_statements may
51-
# timeout otherwise
52-
config_options = {'write_request_timeout_in_ms': '20000'}
53-
ccm_cluster.set_configuration_options(config_options)
54-
ccm_cluster.start(wait_for_binary_proto=True, wait_other_notice=True)
46+
use_singledc(start=False)
47+
ccm_cluster = get_cluster()
48+
ccm_cluster.stop()
49+
# This is necessary because test_too_many_statements may
50+
# timeout otherwise
51+
config_options = {'write_request_timeout_in_ms': '20000'}
52+
ccm_cluster.set_configuration_options(config_options)
53+
ccm_cluster.start(wait_for_binary_proto=True, wait_other_notice=True)
5554

5655
setup_keyspace()
5756

0 commit comments

Comments
 (0)