Skip to content

Commit 692acfb

Browse files
Backport to branch(3.13) : Add integration tests for Cassandra 4 and 5 (#3155)
Co-authored-by: Vincent Guilpain <[email protected]>
1 parent 8035db1 commit 692acfb

File tree

3 files changed

+132
-2
lines changed

3 files changed

+132
-2
lines changed

.github/workflows/ci.yaml

Lines changed: 130 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -247,6 +247,136 @@ jobs:
247247
name: cassandra_3.11_integration_test_reports_${{ matrix.mode.label }}
248248
path: core/build/reports/tests/integrationTestCassandra
249249

250+
integration-test-for-cassandra-4-1:
251+
name: Cassandra 4.1 integration test (${{ matrix.mode.label }})
252+
runs-on: ubuntu-latest
253+
254+
services:
255+
cassandra:
256+
image: cassandra:4.1
257+
env:
258+
MAX_HEAP_SIZE: 2048m
259+
HEAP_NEWSIZE: 512m
260+
ports:
261+
- 9042:9042
262+
263+
strategy:
264+
fail-fast: false
265+
matrix:
266+
mode:
267+
- label: default
268+
group_commit_enabled: false
269+
- label: with_group_commit
270+
group_commit_enabled: true
271+
272+
steps:
273+
- uses: actions/checkout@v5
274+
275+
- name: Set up JDK ${{ env.JAVA_VERSION }} (${{ env.JAVA_VENDOR }})
276+
uses: actions/setup-java@v5
277+
with:
278+
java-version: ${{ env.JAVA_VERSION }}
279+
distribution: ${{ env.JAVA_VENDOR }}
280+
281+
- name: Set up JDK ${{ env.INT_TEST_JAVA_RUNTIME_VERSION }} (${{ env.INT_TEST_JAVA_RUNTIME_VENDOR }}) to run integration test
282+
uses: actions/setup-java@v5
283+
if: ${{ env.SET_UP_INT_TEST_RUNTIME_NON_ORACLE_JDK == 'true'}}
284+
with:
285+
java-version: ${{ env.INT_TEST_JAVA_RUNTIME_VERSION }}
286+
distribution: ${{ env.INT_TEST_JAVA_RUNTIME_VENDOR }}
287+
288+
- name: Login to Oracle container registry
289+
uses: docker/login-action@v3
290+
if: ${{ env.INT_TEST_JAVA_RUNTIME_VENDOR == 'oracle' }}
291+
with:
292+
registry: container-registry.oracle.com
293+
username: ${{ secrets.OCR_USERNAME }}
294+
password: ${{ secrets.OCR_TOKEN }}
295+
296+
- name: Set up JDK ${{ env.INT_TEST_JAVA_RUNTIME_VERSION }} (oracle) to run the integration test
297+
if: ${{ env.INT_TEST_JAVA_RUNTIME_VENDOR == 'oracle' }}
298+
run: |
299+
container_id=$(docker create "container-registry.oracle.com/java/jdk:${{ env.INT_TEST_JAVA_RUNTIME_VERSION }}")
300+
docker cp -L "$container_id:/usr/java/default" /usr/lib/jvm/oracle-jdk && docker rm "$container_id"
301+
302+
- name: Setup Gradle
303+
uses: gradle/actions/setup-gradle@v5
304+
305+
- name: Execute Gradle 'integrationTestCassandra' task
306+
run: ./gradlew integrationTestCassandra ${{ matrix.mode.group_commit_enabled && env.INT_TEST_GRADLE_OPTIONS_FOR_GROUP_COMMIT || '' }}
307+
308+
- name: Upload Gradle test reports
309+
if: always()
310+
uses: actions/upload-artifact@v5
311+
with:
312+
name: cassandra_4.1_integration_test_reports_${{ matrix.mode.label }}
313+
path: core/build/reports/tests/integrationTestCassandra
314+
315+
integration-test-for-cassandra-5-0:
316+
name: Cassandra 5.0 integration test (${{ matrix.mode.label }})
317+
runs-on: ubuntu-latest
318+
319+
services:
320+
cassandra:
321+
image: cassandra:5.0
322+
env:
323+
MAX_HEAP_SIZE: 2048m
324+
HEAP_NEWSIZE: 512m
325+
ports:
326+
- 9042:9042
327+
328+
strategy:
329+
fail-fast: false
330+
matrix:
331+
mode:
332+
- label: default
333+
group_commit_enabled: false
334+
- label: with_group_commit
335+
group_commit_enabled: true
336+
337+
steps:
338+
- uses: actions/checkout@v5
339+
340+
- name: Set up JDK ${{ env.JAVA_VERSION }} (${{ env.JAVA_VENDOR }})
341+
uses: actions/setup-java@v5
342+
with:
343+
java-version: ${{ env.JAVA_VERSION }}
344+
distribution: ${{ env.JAVA_VENDOR }}
345+
346+
- name: Set up JDK ${{ env.INT_TEST_JAVA_RUNTIME_VERSION }} (${{ env.INT_TEST_JAVA_RUNTIME_VENDOR }}) to run integration test
347+
uses: actions/setup-java@v5
348+
if: ${{ env.SET_UP_INT_TEST_RUNTIME_NON_ORACLE_JDK == 'true'}}
349+
with:
350+
java-version: ${{ env.INT_TEST_JAVA_RUNTIME_VERSION }}
351+
distribution: ${{ env.INT_TEST_JAVA_RUNTIME_VENDOR }}
352+
353+
- name: Login to Oracle container registry
354+
uses: docker/login-action@v3
355+
if: ${{ env.INT_TEST_JAVA_RUNTIME_VENDOR == 'oracle' }}
356+
with:
357+
registry: container-registry.oracle.com
358+
username: ${{ secrets.OCR_USERNAME }}
359+
password: ${{ secrets.OCR_TOKEN }}
360+
361+
- name: Set up JDK ${{ env.INT_TEST_JAVA_RUNTIME_VERSION }} (oracle) to run the integration test
362+
if: ${{ env.INT_TEST_JAVA_RUNTIME_VENDOR == 'oracle' }}
363+
run: |
364+
container_id=$(docker create "container-registry.oracle.com/java/jdk:${{ env.INT_TEST_JAVA_RUNTIME_VERSION }}")
365+
docker cp -L "$container_id:/usr/java/default" /usr/lib/jvm/oracle-jdk && docker rm "$container_id"
366+
367+
- name: Setup Gradle
368+
uses: gradle/actions/setup-gradle@v5
369+
370+
- name: Execute Gradle 'integrationTestCassandra' task
371+
run: ./gradlew integrationTestCassandra ${{ matrix.mode.group_commit_enabled && env.INT_TEST_GRADLE_OPTIONS_FOR_GROUP_COMMIT || '' }}
372+
373+
- name: Upload Gradle test reports
374+
if: always()
375+
uses: actions/upload-artifact@v5
376+
with:
377+
name: cassandra_5.0_integration_test_reports_${{ matrix.mode.label }}
378+
path: core/build/reports/tests/integrationTestCassandra
379+
250380
integration-test-for-cosmos:
251381
name: Cosmos DB integration test (${{ matrix.mode.label }})
252382
runs-on: windows-latest

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ subprojects {
2626
guiceVersion = '5.1.0'
2727
guavaVersion = '32.1.3-jre'
2828
slf4jVersion = '1.7.36'
29-
cassandraDriverVersion = '3.11.5'
29+
cassandraDriverVersion = '3.12.1'
3030
azureCosmosVersion = '4.75.0'
3131
jooqVersion = '3.14.16'
3232
awssdkVersion = '2.26.5'

core/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ dependencies {
155155
implementation "com.google.guava:guava:${guavaVersion}"
156156
implementation "com.google.inject:guice:${guiceVersion}"
157157
implementation "org.slf4j:slf4j-api:${slf4jVersion}"
158-
implementation "com.datastax.cassandra:cassandra-driver-core:${cassandraDriverVersion}"
158+
implementation "org.apache.cassandra:cassandra-driver-core:${cassandraDriverVersion}"
159159
implementation "com.azure:azure-cosmos:${azureCosmosVersion}"
160160
implementation "org.jooq:jooq:${jooqVersion}"
161161
implementation platform("software.amazon.awssdk:bom:${awssdkVersion}")

0 commit comments

Comments
 (0)