Skip to content

Commit

Permalink
github actions: run integration test on cassandra
Browse files Browse the repository at this point in the history
to make sure we don't break compitability completly with cassandra
introducing tests with one version of cassandra as well
  • Loading branch information
fruch committed Jun 24, 2024
1 parent fee957a commit 7aeeef4
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 11 deletions.
10 changes: 8 additions & 2 deletions .github/workflows/integration-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,20 @@ jobs:
with:
default: 2.7.14
versions: ${{ matrix.python-version }}
- name: Test with pytest
- name: Test with scylla
run: |
export EVENT_LOOP_MANAGER=${{ matrix.event_loop_manager }}
export SCYLLA_VERSION='release:5.1'
./ci/run_integration_test.sh tests/integration/standard/ tests/integration/cqlengine/
- name: Test tablets
- name: Test with scylla - tablets
run: |
export EVENT_LOOP_MANAGER=${{ matrix.event_loop_manager }}
export SCYLLA_VERSION='unstable/master:2024-01-17T17:56:00Z'
./ci/run_integration_test.sh tests/integration/experiments/
- name: Test with cassandra
run: |
export EVENT_LOOP_MANAGER=${{ matrix.event_loop_manager }}
export CASSANDRA_VERSION='4.1.5'
./ci/run_integration_test.sh tests/integration/standard/
17 changes: 11 additions & 6 deletions ci/run_integration_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,17 @@ pip install awscli
pip install https://github.com/scylladb/scylla-ccm/archive/master.zip

# download version

ccm create scylla-driver-temp -n 1 --scylla --version ${SCYLLA_VERSION}
ccm remove

if [[ -n "${SCYLLA_VERSION}" ]]; then
ccm create scylla-driver-temp -n 1 --scylla --version ${SCYLLA_VERSION}
ccm remove
export MAPPED_SCYLLA_VERSION=3.11.4
unset CASSANDRA_VERSION
fi
if [[ -n "${CASSANDRA_VERSION}" ]]; then
ccm create cassandra-driver-temp -n 1 --version ${CASSANDRA_VERSION}
ccm remove
unset SCYLLA_VERSION
fi
# run test

export MAPPED_SCYLLA_VERSION=3.11.4
PROTOCOL_VERSION=4 pytest -vv -s --log-cli-level=debug -rf --import-mode append $*

14 changes: 11 additions & 3 deletions tests/integration/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ def get_server_versions():

c = TestCluster()
s = c.connect()
row = s.execute('SELECT cql_version, release_version FROM system.local')[0]
row = s.execute('SELECT cql_version, release_version FROM system.local').one()

cass_version = _tuple_version(row.release_version)
cql_version = _tuple_version(row.cql_version)
Expand Down Expand Up @@ -630,8 +630,16 @@ def use_cluster(cluster_name, nodes, ipformat=None, start=True, workloads=None,
else:
CCM_CLUSTER = CCMCluster(path, cluster_name, **ccm_options)
CCM_CLUSTER.set_configuration_options({'start_native_transport': True})
if Version(cassandra_version) >= Version('2.2'):
CCM_CLUSTER.set_configuration_options({'enable_user_defined_functions': True})
if Version(cassandra_version) >= Version('4.1'):
CCM_CLUSTER.set_configuration_options({
'user_defined_functions_enabled': True,
'scripted_user_defined_functions_enabled': True,
'materialized_views_enabled': True,
'sasi_indexes_enabled': True,
'transient_replication_enabled': True,
})
elif Version(cassandra_version) >= Version('2.2'):
CCM_CLUSTER.set_configuration_options({'user_defined_functions_enabled': True})
if Version(cassandra_version) >= Version('3.0'):
CCM_CLUSTER.set_configuration_options({'enable_scripted_user_defined_functions': True})
if Version(cassandra_version) >= Version('4.0-a'):
Expand Down

0 comments on commit 7aeeef4

Please sign in to comment.