Skip to content
Open
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
97 changes: 66 additions & 31 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,18 +55,22 @@ commands:
sstable_format:
type: string
default: "big"
cassandra:
type: string
default: ""
description: Build and test against Spark <<parameters.spark>> Scala <<parameters.scala>> <<parameters.jdk>>
steps:
- run:
environment:
SPARK_VERSION: "<<parameters.spark>>"
SCALA_VERSION: "<<parameters.scala>>"
JDK_VERSION: "<<parameters.jdk>>"
INTEGRATION_MAX_PARALLEL_FORKS: 1
INTEGRATION_MAX_HEAP_SIZE: "1500M"
CORE_MAX_PARALLEL_FORKS: 2
INTEGRATION_MAX_PARALLEL_FORKS: 2
INTEGRATION_MAX_HEAP_SIZE: "3072m"
CORE_MAX_PARALLEL_FORKS: 3
CORE_TEST_MAX_HEAP_SIZE: "2048m"
CASSANDRA_USE_JDK11: <<parameters.use_jdk11>>
CASSANDRA_VERSION: "<<parameters.cassandra>>"
command: |
export GRADLE_OPTS="-Xmx2g -Dorg.gradle.jvmargs=-Xmx2g"
# Run compile/unit tests, skipping integration tests
Expand All @@ -92,7 +96,7 @@ commands:
SPARK_VERSION: "<<parameters.spark>>"
SCALA_VERSION: "<<parameters.scala>>"
JDK_VERSION: "<<parameters.jdk>>"
INTEGRATION_MAX_PARALLEL_FORKS: 1
INTEGRATION_MAX_PARALLEL_FORKS: 2
INTEGRATION_MAX_HEAP_SIZE: "2500M"
CASSANDRA_USE_JDK11: <<parameters.use_jdk11>>
command: |
Expand Down Expand Up @@ -143,7 +147,7 @@ jobs:
- "*.jar"
- "org/**/*"

spark3-2_12-jdk11-big:
spark3-2_12-jdk11-big-c40:
docker:
- image: cimg/openjdk:11.0
resource_class: large
Expand All @@ -158,132 +162,156 @@ jobs:
jdk: "11"
use_jdk11: "true"
sstable_format: "big"
cassandra: "4.0"

- store_artifacts:
when: always
path: build/test-reports
destination: test-reports

- store_artifacts:
when: always
path: build/reports
destination: reports

- store_test_results:
when: always
path: build/test-reports

int-c4-spark3-2_12-jdk11:
parallelism: 8
spark3-2_12-jdk11-big-c41:
docker:
- image: cimg/openjdk:11.0
resource_class: large
steps:
- setup_remote_docker
- install_common
- checkout
- attach_workspace:
at: dependencies
- run_integration:
- run_build:
spark: "3"
scala: "2.12"
jdk: "11"
use_jdk11: "true"
cassandra: "4.1.4"
sstable_format: "big"
cassandra: "4.1"

- store_artifacts:
when: always
path: build/test-reports
destination: test-reports

- store_artifacts:
when: always
path: build/reports
destination: reports

- store_artifacts:
path: cassandra-analytics-integration-tests
destination: int-tests-misc

- store_test_results:
when: always
path: build/test-reports

spark3-2_13-jdk11-big:
int-c4-spark3-2_12-jdk11:
parallelism: 8
docker:
- image: cimg/openjdk:11.0
resource_class: large
steps:
- setup_remote_docker
- install_common
- checkout
- attach_workspace:
at: dependencies
- run_build:
- run_integration:
spark: "3"
scala: "2.13"
scala: "2.12"
jdk: "11"
use_jdk11: "true"
sstable_format: "big"
cassandra: "4.0.17"

- store_artifacts:
when: always
path: build/test-reports
destination: test-reports

- store_artifacts:
when: always
path: build/reports
destination: reports

- store_artifacts:
when: always
path: cassandra-analytics-integration-tests
destination: int-tests-misc

- store_test_results:
when: always
path: build/test-reports

spark3-2_13-jdk11-bti:
int-c41-spark3-2_12-jdk11:
parallelism: 8
docker:
- image: cimg/openjdk:11.0
resource_class: large
steps:
- setup_remote_docker
- install_common
- checkout
- attach_workspace:
at: dependencies
- run_build:
- run_integration:
spark: "3"
scala: "2.13"
scala: "2.12"
jdk: "11"
use_jdk11: "true"
sstable_format: "bti"
cassandra: "4.1.4"

- store_artifacts:
when: always
path: build/test-reports
destination: test-reports

- store_artifacts:
when: always
path: build/reports
destination: reports

- store_artifacts:
when: always
path: cassandra-analytics-integration-tests
destination: int-tests-misc

- store_test_results:
when: always
path: build/test-reports

int-c4-spark3-2_13-jdk11:
parallelism: 8
spark3-2_13-jdk11-bti-c50:
docker:
- image: cimg/openjdk:11.0
resource_class: large
steps:
- setup_remote_docker
- install_common
- checkout
- attach_workspace:
at: dependencies
- run_integration:
- run_build:
spark: "3"
scala: "2.13"
jdk: "11"
use_jdk11: "true"
cassandra: "4.1.4"
sstable_format: "bti"
cassandra: "5.0"

- store_artifacts:
when: always
path: build/test-reports
destination: test-reports

- store_artifacts:
when: always
path: build/reports
destination: reports

- store_test_results:
when: always
path: build/test-reports

int-c5-spark3-2_13-jdk11:
Expand All @@ -305,34 +333,41 @@ jobs:
cassandra: "5.0.5"

- store_artifacts:
when: always
path: build/test-reports
destination: test-reports

- store_artifacts:
when: always
path: build/reports
destination: reports

- store_test_results:
when: always
path: build/test-reports

workflows:
version: 2
build-and-test:
jobs:
- build-deps-jdk11
- spark3-2_12-jdk11-big:

# Unit tests: split by Cassandra version to reduce per-process memory pressure
- spark3-2_12-jdk11-big-c40:
requires:
- build-deps-jdk11
- spark3-2_13-jdk11-big:
- spark3-2_12-jdk11-big-c41:
requires:
- build-deps-jdk11
- spark3-2_13-jdk11-bti:
- spark3-2_13-jdk11-bti-c50:
requires:
- build-deps-jdk11

# Integration tests
- int-c4-spark3-2_12-jdk11:
requires:
- build-deps-jdk11
- int-c4-spark3-2_13-jdk11:
- int-c41-spark3-2_12-jdk11:
requires:
- build-deps-jdk11
- int-c5-spark3-2_13-jdk11:
Expand Down
59 changes: 37 additions & 22 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -73,16 +73,21 @@ jobs:
key: build-${{ github.sha }}

unit-test:
name: Unit test
name: Unit test - Scala ${{ matrix.scala }} ${{ matrix.sstable-format }} C${{ matrix.cassandra }}
needs: build
runs-on: ubuntu-latest
strategy:
matrix:
scala: [ '2.12', '2.13' ]
sstable-format: [ 'big', 'bti' ]
exclude:
- scala: "2.12"
sstable-format: "bti"
include:
- scala: '2.13'
sstable-format: 'bti'
cassandra: '5.0'
- scala: '2.12'
sstable-format: 'big'
cassandra: '4.1'
- scala: '2.12'
sstable-format: 'big'
cassandra: '4.0'
fail-fast: false
steps:
- name: Setup JDK
Expand Down Expand Up @@ -112,29 +117,35 @@ jobs:
export SPARK_VERSION="3"
export SCALA_VERSION="${{ matrix.scala }}"
export JDK_VERSION="11"
export INTEGRATION_MAX_PARALLEL_FORKS=1
export INTEGRATION_MAX_HEAP_SIZE="1500M"
export INTEGRATION_MAX_PARALLEL_FORKS=3
export INTEGRATION_MAX_HEAP_SIZE="2048M"
export CASSANDRA_USE_JDK11=true

export CASSANDRA_VERSION="${{ matrix.cassandra }}"

./gradlew --stacktrace clean assemble check -x cassandra-analytics-integration-tests:test -Dcassandra.analytics.bridges.sstable_format=${{ matrix.sstable-format }}

integration-test:
name: Integration test
name: Integration test - ${{ matrix.config }} (${{ matrix.job_index }})
needs: build
runs-on: ubuntu-latest
strategy:
# GHA generates a cross-product of 'config' × 'job_index' (3 × 5 = 15 jobs).
# The 'include' entries don't add new combinations — they augment existing ones
# by matching on 'config' and injecting 'scala' and 'cassandra' into each match.
# To add a new version: add one entry to 'config' and one to 'include'.
matrix:
scala: [ '2.12', '2.13' ]
cassandra: [ '4.0.17', '4.1.4', '5.0.5' ]
job_index: [ 0, 1, 2, 3, 4 ]
job_total: [ 5 ]
exclude:
- scala: "2.12"
cassandra: "5.0.5"
- scala: "2.12"
cassandra: "4.1.4"
- scala: "2.13"
cassandra: "4.0.17"
config: ['s2.13-c5.0.5', 's2.12-c4.1.4', 's2.12-c4.0.17']
job_index: [0, 1, 2, 3, 4]
include:
- config: 's2.13-c5.0.5'
scala: '2.13'
cassandra: '5.0.5'
- config: 's2.12-c4.1.4'
scala: '2.12'
cassandra: '4.1.4'
- config: 's2.12-c4.0.17'
scala: '2.12'
cassandra: '4.0.17'
fail-fast: false
steps:
- name: Setup JDK
Expand Down Expand Up @@ -174,7 +185,11 @@ jobs:
./gradlew --stacktrace clean assemble

cd cassandra-analytics-integration-tests/src/test/java
CLASSNAMES=$(find . -name '*Test.java' | sort | cut -c 3- | sed 's@/@.@g' | sed 's/.\{5\}$//' | awk 'NR % ${{ matrix.job_total }} == ${{ matrix.job_index }}')
# Shuffle test classes using the commit SHA as seed for reproducible randomization,
# then shard across runners via round-robin on the shuffled order.
CLASSNAMES=$(find . -name '*Test.java' | cut -c 3- | sed 's@/@.@g' | sed 's/.\{5\}$//' \
| python3 -c "import random,sys; lines=sys.stdin.read().splitlines(); random.seed('$GITHUB_SHA'); random.shuffle(lines); print('\n'.join(lines))" \
| awk 'NR % 5 == ${{ matrix.job_index }}')
cd ../../../..

EXIT_STATUS=0
Expand Down
Loading
Loading