Skip to content

PYTHON-1402 Support running test suite with HCD 1.0.0 #1234

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 2 commits into from
Oct 16, 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
59 changes: 43 additions & 16 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ Matrix Types:
Full: All server versions, python runtimes tested with and without Cython.
Cassandra: All cassandra server versions.
Dse: All dse server versions.
Hcd: All hcd server versions.
Smoke: CI-friendly configurations. Currently-supported Python version + modern Cassandra/DSE instances.
We also avoid cython since it's tested as part of the nightlies

Expand All @@ -31,7 +32,8 @@ import com.datastax.jenkins.drivers.python.Slack
slack = new Slack()

DEFAULT_CASSANDRA = ['3.0', '3.11', '4.0', '4.1', '5.0-beta1']
DEFAULT_DSE = ['dse-5.1.35', 'dse-6.8.30']
DEFAULT_DSE = ['dse-5.1.35', 'dse-6.8.30', 'dse-6.9.0']
DEFAULT_HCD = ['hcd-1.0.0']
DEFAULT_RUNTIME = ['3.8.16', '3.9.16', '3.10.11', '3.11.3', '3.12.0']
DEFAULT_CYTHON = ["True", "False"]
matrices = [
Expand All @@ -51,7 +53,7 @@ matrices = [
"CYTHON": DEFAULT_CYTHON
],
"SMOKE": [
"SERVER": DEFAULT_CASSANDRA.takeRight(2) + DEFAULT_DSE.takeRight(1),
"SERVER": DEFAULT_CASSANDRA.takeRight(2) + DEFAULT_DSE.takeRight(2) + DEFAULT_HCD.takeRight(1),
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For the record: I had this wrong in my earlier comment. We should actually be adding only four new builds to our smoke test build matrix with this change: 2 new backends * 2 Python versions (oldest and newest). That should be reasonably manageable. More to the point it's hard to imagine how we'd remove either 6.8.x, 6.9.x or HCD from our test matrix.

"RUNTIME": DEFAULT_RUNTIME.take(1) + DEFAULT_RUNTIME.takeRight(1),
"CYTHON": ["True"]
]
Expand Down Expand Up @@ -224,6 +226,19 @@ DSE_VERSION=${DSE_FIXED_VERSION}
CCM_IS_DSE=true
CCM_BRANCH=${DSE_FIXED_VERSION}
DSE_BRANCH=${DSE_FIXED_VERSION}
ENVIRONMENT_EOF
'''
} else if (env.CASSANDRA_VERSION.split('-')[0] == 'hcd') {
env.HCD_FIXED_VERSION = env.CASSANDRA_VERSION.split('-')[1]
sh label: 'Update environment for DataStax Enterprise', script: '''#!/bin/bash -le
cat >> ${HOME}/environment.txt << ENVIRONMENT_EOF
CCM_CASSANDRA_VERSION=${HCD_FIXED_VERSION} # maintain for backwards compatibility
CCM_VERSION=${HCD_FIXED_VERSION}
CCM_SERVER_TYPE=hcd
HCD_VERSION=${HCD_FIXED_VERSION}
CCM_IS_HCD=true
CCM_BRANCH=${HCD_FIXED_VERSION}
HCD_BRANCH=${HCD_FIXED_VERSION}
ENVIRONMENT_EOF
'''
}
Expand Down Expand Up @@ -276,13 +291,13 @@ def executeStandardTests() {
jabba use 1.8

SIMULACRON_JAR="${HOME}/simulacron.jar"
SIMULACRON_JAR=${SIMULACRON_JAR} EVENT_LOOP=${EVENT_LOOP} CASSANDRA_DIR=${CCM_INSTALL_DIR} CCM_ARGS="${CCM_ARGS}" DSE_VERSION=${DSE_VERSION} CASSANDRA_VERSION=${CCM_CASSANDRA_VERSION} MAPPED_CASSANDRA_VERSION=${MAPPED_CASSANDRA_VERSION} VERIFY_CYTHON=${CYTHON_ENABLED} JVM_EXTRA_OPTS="$JVM_EXTRA_OPTS -Xss384k" pytest -s -v --log-format="[%(levelname)s] %(asctime)s %(thread)d: %(message)s" --ignore=test_backpressure.py --junit-xml=simulacron_results.xml tests/integration/simulacron/ || true
SIMULACRON_JAR=${SIMULACRON_JAR} EVENT_LOOP=${EVENT_LOOP} CASSANDRA_DIR=${CCM_INSTALL_DIR} CCM_ARGS="${CCM_ARGS}" DSE_VERSION=${DSE_VERSION} HCD_VERSION=${HCD_VERSION} CASSANDRA_VERSION=${CCM_CASSANDRA_VERSION} MAPPED_CASSANDRA_VERSION=${MAPPED_CASSANDRA_VERSION} VERIFY_CYTHON=${CYTHON_ENABLED} JVM_EXTRA_OPTS="$JVM_EXTRA_OPTS -Xss384k" pytest -s -v --log-format="[%(levelname)s] %(asctime)s %(thread)d: %(message)s" --ignore=test_backpressure.py --junit-xml=simulacron_results.xml tests/integration/simulacron/ || true

# Run backpressure tests separately to avoid memory issue
SIMULACRON_JAR=${SIMULACRON_JAR} EVENT_LOOP=${EVENT_LOOP} CASSANDRA_DIR=${CCM_INSTALL_DIR} CCM_ARGS="${CCM_ARGS}" DSE_VERSION=${DSE_VERSION} CASSANDRA_VERSION=${CCM_CASSANDRA_VERSION} MAPPED_CASSANDRA_VERSION=${MAPPED_CASSANDRA_VERSION} VERIFY_CYTHON=${CYTHON_ENABLED} JVM_EXTRA_OPTS="$JVM_EXTRA_OPTS -Xss384k" pytest -s -v --log-format="[%(levelname)s] %(asctime)s %(thread)d: %(message)s" --ignore=test_backpressure.py --junit-xml=simulacron_backpressure_1_results.xml tests/integration/simulacron/test_backpressure.py:TCPBackpressureTests.test_paused_connections || true
SIMULACRON_JAR=${SIMULACRON_JAR} EVENT_LOOP=${EVENT_LOOP} CASSANDRA_DIR=${CCM_INSTALL_DIR} CCM_ARGS="${CCM_ARGS}" DSE_VERSION=${DSE_VERSION} CASSANDRA_VERSION=${CCM_CASSANDRA_VERSION} MAPPED_CASSANDRA_VERSION=${MAPPED_CASSANDRA_VERSION} VERIFY_CYTHON=${CYTHON_ENABLED} JVM_EXTRA_OPTS="$JVM_EXTRA_OPTS -Xss384k" pytest -s -v --log-format="[%(levelname)s] %(asctime)s %(thread)d: %(message)s" --ignore=test_backpressure.py --junit-xml=simulacron_backpressure_2_results.xml tests/integration/simulacron/test_backpressure.py:TCPBackpressureTests.test_queued_requests_timeout || true
SIMULACRON_JAR=${SIMULACRON_JAR} EVENT_LOOP=${EVENT_LOOP} CASSANDRA_DIR=${CCM_INSTALL_DIR} CCM_ARGS="${CCM_ARGS}" DSE_VERSION=${DSE_VERSION} CASSANDRA_VERSION=${CCM_CASSANDRA_VERSION} MAPPED_CASSANDRA_VERSION=${MAPPED_CASSANDRA_VERSION} VERIFY_CYTHON=${CYTHON_ENABLED} JVM_EXTRA_OPTS="$JVM_EXTRA_OPTS -Xss384k" pytest -s -v --log-format="[%(levelname)s] %(asctime)s %(thread)d: %(message)s" --ignore=test_backpressure.py --junit-xml=simulacron_backpressure_3_results.xml tests/integration/simulacron/test_backpressure.py:TCPBackpressureTests.test_cluster_busy || true
SIMULACRON_JAR=${SIMULACRON_JAR} EVENT_LOOP=${EVENT_LOOP} CASSANDRA_DIR=${CCM_INSTALL_DIR} CCM_ARGS="${CCM_ARGS}" DSE_VERSION=${DSE_VERSION} CASSANDRA_VERSION=${CCM_CASSANDRA_VERSION} MAPPED_CASSANDRA_VERSION=${MAPPED_CASSANDRA_VERSION} VERIFY_CYTHON=${CYTHON_ENABLED} JVM_EXTRA_OPTS="$JVM_EXTRA_OPTS -Xss384k" pytest -s -v --log-format="[%(levelname)s] %(asctime)s %(thread)d: %(message)s" --ignore=test_backpressure.py --junit-xml=simulacron_backpressure_4_results.xml tests/integration/simulacron/test_backpressure.py:TCPBackpressureTests.test_node_busy || true
SIMULACRON_JAR=${SIMULACRON_JAR} EVENT_LOOP=${EVENT_LOOP} CASSANDRA_DIR=${CCM_INSTALL_DIR} CCM_ARGS="${CCM_ARGS}" DSE_VERSION=${DSE_VERSION} HCD_VERSION=${HCD_VERSION} CASSANDRA_VERSION=${CCM_CASSANDRA_VERSION} MAPPED_CASSANDRA_VERSION=${MAPPED_CASSANDRA_VERSION} VERIFY_CYTHON=${CYTHON_ENABLED} JVM_EXTRA_OPTS="$JVM_EXTRA_OPTS -Xss384k" pytest -s -v --log-format="[%(levelname)s] %(asctime)s %(thread)d: %(message)s" --ignore=test_backpressure.py --junit-xml=simulacron_backpressure_1_results.xml tests/integration/simulacron/test_backpressure.py:TCPBackpressureTests.test_paused_connections || true
SIMULACRON_JAR=${SIMULACRON_JAR} EVENT_LOOP=${EVENT_LOOP} CASSANDRA_DIR=${CCM_INSTALL_DIR} CCM_ARGS="${CCM_ARGS}" DSE_VERSION=${DSE_VERSION} HCD_VERSION=${HCD_VERSION} CASSANDRA_VERSION=${CCM_CASSANDRA_VERSION} MAPPED_CASSANDRA_VERSION=${MAPPED_CASSANDRA_VERSION} VERIFY_CYTHON=${CYTHON_ENABLED} JVM_EXTRA_OPTS="$JVM_EXTRA_OPTS -Xss384k" pytest -s -v --log-format="[%(levelname)s] %(asctime)s %(thread)d: %(message)s" --ignore=test_backpressure.py --junit-xml=simulacron_backpressure_2_results.xml tests/integration/simulacron/test_backpressure.py:TCPBackpressureTests.test_queued_requests_timeout || true
SIMULACRON_JAR=${SIMULACRON_JAR} EVENT_LOOP=${EVENT_LOOP} CASSANDRA_DIR=${CCM_INSTALL_DIR} CCM_ARGS="${CCM_ARGS}" DSE_VERSION=${DSE_VERSION} HCD_VERSION=${HCD_VERSION} CASSANDRA_VERSION=${CCM_CASSANDRA_VERSION} MAPPED_CASSANDRA_VERSION=${MAPPED_CASSANDRA_VERSION} VERIFY_CYTHON=${CYTHON_ENABLED} JVM_EXTRA_OPTS="$JVM_EXTRA_OPTS -Xss384k" pytest -s -v --log-format="[%(levelname)s] %(asctime)s %(thread)d: %(message)s" --ignore=test_backpressure.py --junit-xml=simulacron_backpressure_3_results.xml tests/integration/simulacron/test_backpressure.py:TCPBackpressureTests.test_cluster_busy || true
SIMULACRON_JAR=${SIMULACRON_JAR} EVENT_LOOP=${EVENT_LOOP} CASSANDRA_DIR=${CCM_INSTALL_DIR} CCM_ARGS="${CCM_ARGS}" DSE_VERSION=${DSE_VERSION} HCD_VERSION=${HCD_VERSION} CASSANDRA_VERSION=${CCM_CASSANDRA_VERSION} MAPPED_CASSANDRA_VERSION=${MAPPED_CASSANDRA_VERSION} VERIFY_CYTHON=${CYTHON_ENABLED} JVM_EXTRA_OPTS="$JVM_EXTRA_OPTS -Xss384k" pytest -s -v --log-format="[%(levelname)s] %(asctime)s %(thread)d: %(message)s" --ignore=test_backpressure.py --junit-xml=simulacron_backpressure_4_results.xml tests/integration/simulacron/test_backpressure.py:TCPBackpressureTests.test_node_busy || true
'''

sh label: 'Execute CQL engine integration tests', script: '''#!/bin/bash -lex
Expand All @@ -294,7 +309,7 @@ def executeStandardTests() {
. ${JABBA_SHELL}
jabba use 1.8

EVENT_LOOP=${EVENT_LOOP} CCM_ARGS="${CCM_ARGS}" DSE_VERSION=${DSE_VERSION} CASSANDRA_VERSION=${CCM_CASSANDRA_VERSION} MAPPED_CASSANDRA_VERSION=${MAPPED_CASSANDRA_VERSION} VERIFY_CYTHON=${CYTHON_ENABLED} JVM_EXTRA_OPTS="$JVM_EXTRA_OPTS -Xss384k" pytest -s -v --log-format="[%(levelname)s] %(asctime)s %(thread)d: %(message)s" --junit-xml=cqle_results.xml tests/integration/cqlengine/ || true
EVENT_LOOP=${EVENT_LOOP} CCM_ARGS="${CCM_ARGS}" DSE_VERSION=${DSE_VERSION} HCD_VERSION=${HCD_VERSION} CASSANDRA_VERSION=${CCM_CASSANDRA_VERSION} MAPPED_CASSANDRA_VERSION=${MAPPED_CASSANDRA_VERSION} VERIFY_CYTHON=${CYTHON_ENABLED} JVM_EXTRA_OPTS="$JVM_EXTRA_OPTS -Xss384k" pytest -s -v --log-format="[%(levelname)s] %(asctime)s %(thread)d: %(message)s" --junit-xml=cqle_results.xml tests/integration/cqlengine/ || true
'''

sh label: 'Execute Apache CassandraⓇ integration tests', script: '''#!/bin/bash -lex
Expand All @@ -306,7 +321,7 @@ def executeStandardTests() {
. ${JABBA_SHELL}
jabba use 1.8

EVENT_LOOP=${EVENT_LOOP} CCM_ARGS="${CCM_ARGS}" DSE_VERSION=${DSE_VERSION} CASSANDRA_VERSION=${CCM_CASSANDRA_VERSION} MAPPED_CASSANDRA_VERSION=${MAPPED_CASSANDRA_VERSION} VERIFY_CYTHON=${CYTHON_ENABLED} JVM_EXTRA_OPTS="$JVM_EXTRA_OPTS -Xss384k" pytest -s -v --log-format="[%(levelname)s] %(asctime)s %(thread)d: %(message)s" --junit-xml=standard_results.xml tests/integration/standard/ || true
EVENT_LOOP=${EVENT_LOOP} CCM_ARGS="${CCM_ARGS}" DSE_VERSION=${DSE_VERSION} HCD_VERSION=${HCD_VERSION} CASSANDRA_VERSION=${CCM_CASSANDRA_VERSION} MAPPED_CASSANDRA_VERSION=${MAPPED_CASSANDRA_VERSION} VERIFY_CYTHON=${CYTHON_ENABLED} JVM_EXTRA_OPTS="$JVM_EXTRA_OPTS -Xss384k" pytest -s -v --log-format="[%(levelname)s] %(asctime)s %(thread)d: %(message)s" --junit-xml=standard_results.xml tests/integration/standard/ || true
'''

if (env.CASSANDRA_VERSION.split('-')[0] == 'dse' && env.CASSANDRA_VERSION.split('-')[1] != '4.8') {
Expand All @@ -323,7 +338,7 @@ def executeStandardTests() {
. ${JABBA_SHELL}
jabba use 1.8

EVENT_LOOP=${EVENT_LOOP} CASSANDRA_DIR=${CCM_INSTALL_DIR} DSE_VERSION=${DSE_VERSION} ADS_HOME="${HOME}/" VERIFY_CYTHON=${CYTHON_ENABLED} JVM_EXTRA_OPTS="$JVM_EXTRA_OPTS -Xss384k" pytest -s -v --log-format="[%(levelname)s] %(asctime)s %(thread)d: %(message)s" --junit-xml=dse_results.xml tests/integration/advanced/ || true
EVENT_LOOP=${EVENT_LOOP} CASSANDRA_DIR=${CCM_INSTALL_DIR} DSE_VERSION=${DSE_VERSION} HCD_VERSION=${HCD_VERSION} ADS_HOME="${HOME}/" VERIFY_CYTHON=${CYTHON_ENABLED} JVM_EXTRA_OPTS="$JVM_EXTRA_OPTS -Xss384k" pytest -s -v --log-format="[%(levelname)s] %(asctime)s %(thread)d: %(message)s" --junit-xml=dse_results.xml tests/integration/advanced/ || true
'''
}
}
Expand All @@ -350,7 +365,7 @@ def executeStandardTests() {
. ${JABBA_SHELL}
jabba use 1.8

EVENT_LOOP=${EVENT_LOOP} CCM_ARGS="${CCM_ARGS}" DSE_VERSION=${DSE_VERSION} CASSANDRA_VERSION=${CCM_CASSANDRA_VERSION} MAPPED_CASSANDRA_VERSION=${MAPPED_CASSANDRA_VERSION} VERIFY_CYTHON=${CYTHON_ENABLED} JVM_EXTRA_OPTS="$JVM_EXTRA_OPTS -Xss384k" pytest -s -v --log-format="[%(levelname)s] %(asctime)s %(thread)d: %(message)s" --ignore=tests/integration/long/upgrade --junit-xml=long_results.xml tests/integration/long/ || true
EVENT_LOOP=${EVENT_LOOP} CCM_ARGS="${CCM_ARGS}" DSE_VERSION=${DSE_VERSION} HCD_VERSION=${HCD_VERSION} CASSANDRA_VERSION=${CCM_CASSANDRA_VERSION} MAPPED_CASSANDRA_VERSION=${MAPPED_CASSANDRA_VERSION} VERIFY_CYTHON=${CYTHON_ENABLED} JVM_EXTRA_OPTS="$JVM_EXTRA_OPTS -Xss384k" pytest -s -v --log-format="[%(levelname)s] %(asctime)s %(thread)d: %(message)s" --ignore=tests/integration/long/upgrade --junit-xml=long_results.xml tests/integration/long/ || true
'''
}
}
Expand Down Expand Up @@ -389,7 +404,7 @@ def executeEventLoopTests() {
"tests/integration/simulacron/test_endpoint.py"
"tests/integration/long/test_ssl.py"
)
EVENT_LOOP=${EVENT_LOOP} CCM_ARGS="${CCM_ARGS}" DSE_VERSION=${DSE_VERSION} CASSANDRA_VERSION=${CCM_CASSANDRA_VERSION} MAPPED_CASSANDRA_VERSION=${MAPPED_CASSANDRA_VERSION} VERIFY_CYTHON=${CYTHON_ENABLED} JVM_EXTRA_OPTS="$JVM_EXTRA_OPTS -Xss384k" pytest -s -v --log-format="[%(levelname)s] %(asctime)s %(thread)d: %(message)s" --junit-xml=standard_results.xml ${EVENT_LOOP_TESTS[@]} || true
EVENT_LOOP=${EVENT_LOOP} CCM_ARGS="${CCM_ARGS}" DSE_VERSION=${DSE_VERSION} HCD_VERSION=${HCD_VERSION} CASSANDRA_VERSION=${CCM_CASSANDRA_VERSION} MAPPED_CASSANDRA_VERSION=${MAPPED_CASSANDRA_VERSION} VERIFY_CYTHON=${CYTHON_ENABLED} JVM_EXTRA_OPTS="$JVM_EXTRA_OPTS -Xss384k" pytest -s -v --log-format="[%(levelname)s] %(asctime)s %(thread)d: %(message)s" --junit-xml=standard_results.xml ${EVENT_LOOP_TESTS[@]} || true
'''
}

Expand Down Expand Up @@ -496,7 +511,7 @@ pipeline {
</table>''')
choice(
name: 'MATRIX',
choices: ['DEFAULT', 'SMOKE', 'FULL', 'CASSANDRA', 'DSE'],
choices: ['DEFAULT', 'SMOKE', 'FULL', 'CASSANDRA', 'DSE', 'HCD'],
description: '''<p>The matrix for the build.</p>
<table style="width:100%">
<col width="25%">
Expand Down Expand Up @@ -525,14 +540,18 @@ pipeline {
<td><strong>DSE</strong></td>
<td>All dse server versions.</td>
</tr>
<tr>
<td><strong>HCD</strong></td>
<td>All hcd server versions.</td>
</tr>
</table>''')
choice(
name: 'PYTHON_VERSION',
choices: ['DEFAULT'] + DEFAULT_RUNTIME,
description: 'Python runtime version. Default to the build context.')
choice(
name: 'SERVER_VERSION',
choices: ['DEFAULT'] + DEFAULT_CASSANDRA + DEFAULT_DSE,
choices: ['DEFAULT'] + DEFAULT_CASSANDRA + DEFAULT_DSE + DEFAULT_HCD,
description: '''Apache CassandraⓇ and DataStax Enterprise server version to use for adhoc <b>BUILD-AND-EXECUTE-TESTS</b> <strong>ONLY!</strong>
<table style="width:100%">
<col width="15%">
Expand Down Expand Up @@ -567,7 +586,15 @@ pipeline {
</tr>
<tr>
<td><strong>dse-6.8.30</strong></td>
<td>DataStax Enterprise v6.8.x (<b>CURRENTLY UNDER DEVELOPMENT</b>)</td>
<td>DataStax Enterprise v6.8.x</td>
</tr>
<tr>
<td><strong>dse-6.9.0</strong></td>
<td>DataStax Enterprise v6.9.x (<b>CURRENTLY UNDER DEVELOPMENT</b>)</td>
</tr>
<tr>
<td><strong>hcd-1.0.0</strong></td>
<td>DataStax HCD v1.0.x (<b>CURRENTLY UNDER DEVELOPMENT</b>)</td>
</tr>
</table>''')
choice(
Expand Down Expand Up @@ -648,7 +675,7 @@ pipeline {
parameterizedCron(branchPatternCron().matcher(env.BRANCH_NAME).matches() ? """
# Every weeknight (Monday - Friday) around 4:00 AM
# These schedules will run with and without Cython enabled for Python 3.8.16 and 3.12.0
H 4 * * 1-5 %CI_SCHEDULE=WEEKNIGHTS;EVENT_LOOP=LIBEV;CI_SCHEDULE_PYTHON_VERSION=3.8.16 3.12.0;CI_SCHEDULE_SERVER_VERSION=3.11 4.0 5.0-beta1 dse-5.1.35 dse-6.8.30
H 4 * * 1-5 %CI_SCHEDULE=WEEKNIGHTS;EVENT_LOOP=LIBEV;CI_SCHEDULE_PYTHON_VERSION=3.8.16 3.12.0;CI_SCHEDULE_SERVER_VERSION=3.11 4.0 5.0-beta1 dse-5.1.35 dse-6.8.30 dse-6.9.0 hcd-1.0.0
""" : "")
}

Expand Down
2 changes: 1 addition & 1 deletion test-requirements.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
-r requirements.txt
scales
pytest
ccm>=2.1.2
ccm>=3.1.5
pytz
sure
pure-sasl
Expand Down
30 changes: 28 additions & 2 deletions tests/integration/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@

try:
from ccmlib.dse_cluster import DseCluster
from ccmlib.hcd_cluster import HcdCluster
from ccmlib.cluster import Cluster as CCMCluster
from ccmlib.cluster_factory import ClusterFactory as CCMClusterFactory
from ccmlib import common
Expand Down Expand Up @@ -147,6 +148,10 @@ def _get_cass_version_from_dse(dse_version):
return Version(cass_ver)


def _get_cass_version_from_hcd(hcd_version):
return Version("4.0.11")


def _get_dse_version_from_cass(cass_version):
if cass_version.startswith('2.1'):
dse_ver = "4.8.15"
Expand All @@ -166,13 +171,18 @@ def _get_dse_version_from_cass(cass_version):
SIMULACRON_JAR = os.getenv('SIMULACRON_JAR', None)
CLOUD_PROXY_PATH = os.getenv('CLOUD_PROXY_PATH', None)

# Supported Clusters: Cassandra, DDAC, DSE
# Supported Clusters: Cassandra, DDAC, DSE, HCD
DSE_VERSION = None
HCD_VERSION = None
if os.getenv('DSE_VERSION', None): # we are testing against DSE
DSE_VERSION = Version(os.getenv('DSE_VERSION', None))
DSE_CRED = os.getenv('DSE_CREDS', None)
CASSANDRA_VERSION = _get_cass_version_from_dse(DSE_VERSION.base_version)
CCM_VERSION = DSE_VERSION.base_version
elif os.getenv('HCD_VERSION', None): # we are testing against HCD
HCD_VERSION = Version(os.getenv('HCD_VERSION', None))
CASSANDRA_VERSION = _get_cass_version_from_hcd(HCD_VERSION.base_version)
CCM_VERSION = HCD_VERSION.base_version
else: # we are testing against Cassandra or DDAC
cv_string = os.getenv('CASSANDRA_VERSION', None)
mcv_string = os.getenv('MAPPED_CASSANDRA_VERSION', None)
Expand All @@ -196,6 +206,9 @@ def _get_dse_version_from_cass(cass_version):
if DSE_CRED:
log.info("Using DSE credentials file located at {0}".format(DSE_CRED))
CCM_KWARGS['dse_credentials_file'] = DSE_CRED
elif HCD_VERSION:
log.info('Using HCD version: %s', HCD_VERSION)
CCM_KWARGS['version'] = HCD_VERSION
elif CASSANDRA_DIR:
log.info("Using Cassandra dir: %s", CASSANDRA_DIR)
CCM_KWARGS['install_dir'] = CASSANDRA_DIR
Expand Down Expand Up @@ -463,8 +476,9 @@ def use_cluster(cluster_name, nodes, ipformat=None, start=True, workloads=None,
dse_options = dse_options or {}
workloads = workloads or []
dse_cluster = True if DSE_VERSION else False
hcd_cluster = True if HCD_VERSION else False

if ccm_options is None and DSE_VERSION:
if ccm_options is None and (DSE_VERSION or HCD_VERSION):
ccm_options = {"version": CCM_VERSION}
elif ccm_options is None:
ccm_options = CCM_KWARGS.copy()
Expand Down Expand Up @@ -562,6 +576,18 @@ def use_cluster(cluster_name, nodes, ipformat=None, start=True, workloads=None,
CCM_CLUSTER.populate(nodes, ipformat=ipformat)

CCM_CLUSTER.set_dse_configuration_options(dse_options)
elif hcd_cluster:
CCM_CLUSTER = HcdCluster(path, cluster_name, **ccm_options)
CCM_CLUSTER.set_configuration_options({'start_native_transport': True})
CCM_CLUSTER.set_configuration_options({'batch_size_warn_threshold_in_kb': 5})
CCM_CLUSTER.set_configuration_options({'enable_user_defined_functions': True})
CCM_CLUSTER.set_configuration_options({'enable_scripted_user_defined_functions': True})
CCM_CLUSTER.set_configuration_options({'enable_materialized_views': True})
CCM_CLUSTER.set_configuration_options({'enable_sasi_indexes': True})
CCM_CLUSTER.set_configuration_options({'enable_transient_replication': True})
common.switch_cluster(path, cluster_name)
CCM_CLUSTER.set_configuration_options(configuration_options)
CCM_CLUSTER.populate(nodes, ipformat=ipformat, use_single_interface=use_single_interface)
else:
ccm_cluster_clz = CCMCluster if Version(cassandra_version) < Version('4.1') else Cassandra41CCMCluster
CCM_CLUSTER = ccm_cluster_clz(path, cluster_name, **ccm_options)
Expand Down
Loading