Skip to content

Commit acfb238

Browse files
authored
Add integration tests for Cassandra 4 and 5 (#3143)
1 parent 678ec17 commit acfb238

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

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

core/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ dependencies {
167167
implementation "com.google.guava:guava:${guavaVersion}"
168168
implementation "com.google.inject:guice:${guiceVersion}"
169169
implementation "org.slf4j:slf4j-api:${slf4jVersion}"
170-
implementation "com.datastax.cassandra:cassandra-driver-core:${cassandraDriverVersion}"
170+
implementation "org.apache.cassandra:cassandra-driver-core:${cassandraDriverVersion}"
171171
implementation "com.azure:azure-cosmos:${azureCosmosVersion}"
172172
implementation "com.azure:azure-storage-blob:${azureBlobStorageVersion}"
173173
implementation "org.jooq:jooq:${jooqVersion}"

0 commit comments

Comments
 (0)