Skip to content

Commit 0a7738c

Browse files
committed
Support running integration tests with scylla-ccm
1 parent 5d7637d commit 0a7738c

File tree

1 file changed

+13
-15
lines changed

1 file changed

+13
-15
lines changed

tests/integration/__init__.py

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242

4343
try:
4444
from ccmlib.dse_cluster import DseCluster
45-
from ccmlib.cluster import Cluster as CCMCluster
45+
from ccmlib.scylla_cluster import ScyllaCluster as CCMCluster
4646
from ccmlib.cluster_factory import ClusterFactory as CCMClusterFactory
4747
from ccmlib import common
4848
except ImportError as e:
@@ -185,12 +185,10 @@ def _get_dse_version_from_cass(cass_version):
185185
if DSE_CRED:
186186
log.info("Using DSE credentials file located at {0}".format(DSE_CRED))
187187
CCM_KWARGS['dse_credentials_file'] = DSE_CRED
188-
elif CASSANDRA_DIR:
189-
log.info("Using Cassandra dir: %s", CASSANDRA_DIR)
190-
CCM_KWARGS['install_dir'] = CASSANDRA_DIR
191-
else:
192-
log.info('Using Cassandra version: %s', CCM_VERSION)
193-
CCM_KWARGS['version'] = CCM_VERSION
188+
if os.getenv('INSTALL_DIRECTORY'):
189+
CCM_KWARGS['install_dir'] = os.path.join(os.getenv('INSTALL_DIRECTORY'))
190+
elif os.getenv('SCYLLA_VERSION'):
191+
CCM_KWARGS['cassandra_version'] = os.path.join(os.getenv('SCYLLA_VERSION'))
194192

195193

196194
#This changes the default contact_point parameter in Cluster
@@ -429,10 +427,10 @@ def is_current_cluster(cluster_name, node_counts, workloads):
429427
if CCM_CLUSTER and CCM_CLUSTER.name == cluster_name:
430428
if [len(list(nodes)) for dc, nodes in
431429
groupby(CCM_CLUSTER.nodelist(), lambda n: n.data_center)] == node_counts:
432-
for node in CCM_CLUSTER.nodelist():
433-
if set(node.workloads) != set(workloads):
434-
print("node workloads don't match creating new cluster")
435-
return False
430+
#for node in CCM_CLUSTER.nodelist():
431+
# if set(node.workloads) != set(workloads):
432+
# print("node workloads don't match creating new cluster")
433+
# return False
436434
return True
437435
return False
438436

@@ -525,7 +523,7 @@ def use_cluster(cluster_name, nodes, ipformat=None, start=True, workloads=None,
525523
CCM_CLUSTER.set_dse_configuration_options(dse_options)
526524
else:
527525
CCM_CLUSTER = CCMCluster(path, cluster_name, **ccm_options)
528-
CCM_CLUSTER.set_configuration_options({'start_native_transport': True})
526+
CCM_CLUSTER.set_configuration_options({'start_native_transport': True, 'experimental': True})
529527
if cassandra_version >= Version('2.2'):
530528
CCM_CLUSTER.set_configuration_options({'enable_user_defined_functions': True})
531529
if cassandra_version >= Version('3.0'):
@@ -539,9 +537,9 @@ def use_cluster(cluster_name, nodes, ipformat=None, start=True, workloads=None,
539537

540538
# This will enable the Mirroring query handler which will echo our custom payload k,v pairs back
541539

542-
if 'graph' not in workloads:
543-
if PROTOCOL_VERSION >= 4:
544-
jvm_args = [" -Dcassandra.custom_query_handler_class=org.apache.cassandra.cql3.CustomPayloadMirroringQueryHandler"]
540+
#if 'graph' not in workloads:
541+
# if PROTOCOL_VERSION >= 4:
542+
# jvm_args = [" -Dcassandra.custom_query_handler_class=org.apache.cassandra.cql3.CustomPayloadMirroringQueryHandler"]
545543
if len(workloads) > 0:
546544
for node in CCM_CLUSTER.nodes.values():
547545
node.set_workloads(workloads)

0 commit comments

Comments
 (0)