Skip to content

Commit 00ec316

Browse files
Backport to branch(3.14) : Add integration tests for Cassandra 4 and 5 (#3154)
Co-authored-by: Vincent Guilpain <[email protected]>
1 parent 17148c3 commit 00ec316

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
@@ -243,6 +243,136 @@ jobs:
243243
name: cassandra_3.11_integration_test_reports_${{ matrix.mode.label }}
244244
path: core/build/reports/tests/integrationTestCassandra
245245

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

core/build.gradle

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

0 commit comments

Comments
 (0)