Skip to content

4.x: Improve DefaultMetadata's TabletMap tablet invalidation logic #777

4.x: Improve DefaultMetadata's TabletMap tablet invalidation logic

4.x: Improve DefaultMetadata's TabletMap tablet invalidation logic #777

Workflow file for this run

name: 'Tests (Driver 4.x)'
on:
push:
branches: [ scylla-4.*x ]
pull_request:
branches: [ scylla-4.*x ]
workflow_dispatch:
jobs:
build:
name: Build
runs-on: ubuntu-latest
timeout-minutes: 10
strategy:
matrix:
java-version: [8]
fail-fast: false
steps:
- name: Checkout source
uses: actions/checkout@v4
- name: Set up JDK ${{ matrix.java-version }}
uses: actions/setup-java@v4
with:
java-version: ${{ matrix.java-version }}
distribution: 'adopt'
- name: Get POM hash
id: get-pom-hash
run: echo "value=${{ hashFiles('**/pom.xml') }}" >> "$GITHUB_OUTPUT"
- name: Restore maven repository cache
uses: actions/cache/restore@v4
id: java-cache
with:
path: ~/.m2/repository
key: ${{ runner.os }}-${{ matrix.java-version }}-maven-${{ steps.get-pom-hash.outputs.value }}
- name: Compile source and tests
run: mvn -B compile test-compile -Dfmt.skip=true -Dclirr.skip=true -Danimal.sniffer.skip=true
- name: Download test dependencies
if: steps.java-cache.outputs.cache-hit != 'true'
run: mvn -B test -Dtest=TestThatDoesNotExists -Dfmt.skip=true -Dclirr.skip=true -Danimal.sniffer.skip=true || true
- name: Download verify dependencies
if: steps.java-cache.outputs.cache-hit != 'true'
run: mvn -B verify -DskipTests || true
- name: Save maven repository cache
uses: actions/cache/save@v4
if: steps.java-cache.outputs.cache-hit != 'true'
with:
path: ~/.m2/repository
key: ${{ runner.os }}-${{ matrix.java-version }}-maven-${{ steps.get-pom-hash.outputs.value }}
verify:
name: Full verify
runs-on: ubuntu-latest
timeout-minutes: 10
strategy:
matrix:
java-version: [8]
fail-fast: false
steps:
- name: Checkout source
uses: actions/checkout@v4
- name: Set up JDK ${{ matrix.java-version }}
uses: actions/setup-java@v4
with:
java-version: ${{ matrix.java-version }}
distribution: 'adopt'
- name: Restore maven repository cache
uses: actions/cache/restore@v4
with:
path: ~/.m2/repository
key: ${{ runner.os }}-${{ matrix.java-version }}-maven-${{ hashFiles('**/pom.xml') }}
- name: Full verify
run: mvn -B verify -DskipTests
unit-tests:
name: Unit tests
runs-on: ubuntu-latest
timeout-minutes: 10
strategy:
matrix:
java-version: [8]
fail-fast: false
steps:
- name: Checkout source
uses: actions/checkout@v4
- name: Set up JDK 8
uses: actions/setup-java@v4
with:
java-version: ${{ matrix.java-version }}
distribution: 'adopt'
- name: Restore maven repository cache
uses: actions/cache/restore@v4
with:
path: ~/.m2/repository
key: ${{ runner.os }}-${{ matrix.java-version }}-maven-${{ hashFiles('**/pom.xml') }}
- name: Run unit tests
run: mvn -B test -Dfmt.skip=true -Dclirr.skip=true -Danimal.sniffer.skip=true
- name: Copy test results
if: success() || failure()
run: |
shopt -s globstar
mkdir unit
cp --parents ./**/target/*-reports/*.xml unit/
- name: Upload test results
uses: actions/upload-artifact@v4
if: success() || failure()
with:
name: test-results
path: "*/**/target/*-reports/*.xml"
setup-integration-tests:
name: Setup ITs
runs-on: ubuntu-latest
timeout-minutes: 2
steps:
- name: Checkout source
uses: actions/checkout@v4
- name: Setup Python 3
uses: actions/setup-python@v5
with:
python-version: '3.11'
cassandra-integration-tests:
name: Cassandra ITs
runs-on: ubuntu-latest
needs: [setup-integration-tests]
timeout-minutes: 90
strategy:
matrix:
cassandra-version: [RELEASE-3.X, RELEASE-4.X]
java-version: [8]
fail-fast: false
steps:
- name: Checkout source
uses: actions/checkout@v4
- name: Set up JDK ${{ matrix.java-version }}
uses: actions/setup-java@v4
with:
java-version: ${{ matrix.java-version }}
distribution: 'adopt'
- name: Restore maven repository cache
uses: actions/cache/restore@v4
with:
path: ~/.m2/repository
key: ${{ runner.os }}-${{ matrix.java-version }}-maven-${{ hashFiles('**/pom.xml') }}
- name: Setup Python 3
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Setup environment
run: |
pip3 install https://github.com/scylladb/scylla-ccm/archive/81076bce792a0fb3f2050e4c209a93e4a62ab55f.zip
- name: Get cassandra version
id: cassandra-version
run: |
if [[ "${{ matrix.cassandra-version }}" == "RELEASE-3.X" ]]; then
echo "value=$(python3 ci/version_fetch.py --version-index 1 cassandra3-stable:1 | tr -d '\"')" >> $GITHUB_OUTPUT
elif [[ "${{ matrix.cassandra-version }}" == "RELEASE-4.X" ]]; then
echo "value=$(python3 ci/version_fetch.py --version-index 1 cassandra4-stable:1 | tr -d '\"')" >> $GITHUB_OUTPUT
else
echo "Unknown cassandra version name `${{ matrix.cassandra-version }}`"
fi
- name: Pull CCM image from the cache
uses: actions/cache/restore@v4
id: ccm-cache
with:
path: ~/.ccm/repository
key: ccm-cassandra-${{ runner.os }}-${{ steps.cassandra-version.outputs.value }}
- name: Download Cassandra (${{ steps.cassandra-version.outputs.value }}) image
if: steps.ccm-cache.outputs.cache-hit != 'true'
run: |
rm -rf /tmp/download.ccm || true
mkdir /tmp/download.ccm || true
ccm create ccm_1 -i 127.0.1. -n 3:0 -v "${{ steps.cassandra-version.outputs.value }}" --config-dir=/tmp/download.ccm
rm -rf /tmp/download.ccm
- name: Save CCM image into the cache
if: steps.ccm-cache.outputs.cache-hit != 'true'
uses: actions/cache/save@v4
with:
path: ~/.ccm/repository
key: ccm-cassandra-${{ runner.os }}-${{ steps.cassandra-version.outputs.value }}
- name: Run integration tests on Cassandra (${{ steps.cassandra-version.outputs.value }})
id: run-integration-tests
run: mvn -B -e verify -Dccm.version=${{ steps.cassandra-version.outputs.value }} -Dfmt.skip=true -Dclirr.skip=true -Danimal.sniffer.skip=true
- name: Copy test results
if: steps.run-integration-tests.outcome == 'failure'
run: |
shopt -s globstar
mkdir cassandra-${{ matrix.cassandra-version }}
cp --parents ./**/target/*-reports/*.xml cassandra-${{ matrix.cassandra-version }}/
- name: Upload test results
if: steps.run-integration-tests.outcome == 'failure'
uses: actions/upload-artifact@v4
with:
name: test-results-${{ matrix.java-version }}-${{ matrix.cassandra-version }}
path: "*/**/target/*-reports/*.xml"
- name: Upload CCM logs
uses: actions/upload-artifact@v4
if: failure()
with:
name: ccm-log-cassandra-${{ matrix.java-version }}-${{ matrix.cassandra-version }}
path: /tmp/ccm*/ccm*/node*/logs/*
scylla-integration-tests:
name: Scylla ITs
runs-on: ubuntu-latest
needs: [setup-integration-tests]
timeout-minutes: 90
strategy:
matrix:
scylla-version: [ENTERPRISE-RELEASE, ENTERPRISE-PRIOR-RELEASE, OSS-RELEASE, OSS-PRIOR-RELEASE]
java-version: [8]
fail-fast: false
steps:
- name: Checkout source
uses: actions/checkout@v4
- name: Set up JDK ${{ matrix.java-version }}
uses: actions/setup-java@v4
with:
java-version: ${{ matrix.java-version }}
distribution: 'adopt'
- name: Restore maven repository cache
uses: actions/cache/restore@v4
with:
path: ~/.m2/repository
key: ${{ runner.os }}-${{ matrix.java-version }}-maven-${{ hashFiles('**/pom.xml') }}
- name: Setup Python 3
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Setup environment
run: |
pip3 install https://github.com/scylladb/scylla-ccm/archive/81076bce792a0fb3f2050e4c209a93e4a62ab55f.zip
sudo sh -c "echo 2097152 > /proc/sys/fs/aio-max-nr"
- name: Get scylla version
id: scylla-version
run: |
if [[ "${{ matrix.scylla-version }}" == "ENTERPRISE-RELEASE" ]]; then
echo "value=$(python3 ci/version_fetch.py --version-index 1 scylla-enterprise-stable:1 | tr -d '\"')" >> $GITHUB_OUTPUT
elif [[ "${{ matrix.scylla-version }}" == "ENTERPRISE-PRIOR-RELEASE" ]]; then
echo "value=$(python3 ci/version_fetch.py --version-index 2 scylla-enterprise-stable:2 | tr -d '\"')" >> $GITHUB_OUTPUT
elif [[ "${{ matrix.scylla-version }}" == "ENTERPRISE-RC" ]]; then
echo "value=$(python3 ci/version_fetch.py --version-index 1 scylla-enterprise-rc | tr -d '\"')" >> $GITHUB_OUTPUT
elif [[ "${{ matrix.scylla-version }}" == "OSS-RELEASE" ]]; then
echo "value=$(python3 ci/version_fetch.py --version-index 1 scylla-oss-stable:1 | tr -d '\"')" >> $GITHUB_OUTPUT
elif [[ "${{ matrix.scylla-version }}" == "OSS-PRIOR-RELEASE" ]]; then
echo "value=$(python3 ci/version_fetch.py --version-index 2 scylla-oss-stable:2 | tr -d '\"')" >> $GITHUB_OUTPUT
elif [[ "${{ matrix.scylla-version }}" == "OSS-RC" ]]; then
echo "value=$(python3 ci/version_fetch.py --version-index 1 scylla-oss-rc | tr -d '\"')" >> $GITHUB_OUTPUT
else
echo "Unknown scylla version name `${{ matrix.scylla-version }}`"
exit 1
fi
- name: Pull CCM image from the cache
uses: actions/cache/restore@v4
id: ccm-cache
with:
path: ~/.ccm/repository
key: ccm-scylla-${{ runner.os }}-${{ steps.scylla-version.outputs.value }}
- name: Download Scylla (${{ steps.scylla-version.outputs.value }}) image
if: steps.ccm-cache.outputs.cache-hit != 'true'
run: |
rm -rf /tmp/download.ccm || true
mkdir /tmp/download.ccm || true
ccm create ccm_1 -i 127.0.1. -n 3:0 -v "release:${{ steps.scylla-version.outputs.value }}" --scylla --config-dir=/tmp/download.ccm
rm -rf /tmp/download.ccm
- name: Save CCM image into the cache
uses: actions/cache/save@v4
if: steps.ccm-cache.outputs.cache-hit != 'true'
with:
path: ~/.ccm/repository
key: ccm-scylla-${{ runner.os }}-${{ steps.scylla-version.outputs.value }}
- name: Run integration tests on Scylla (${{ steps.scylla-version.outputs.value }})
id: run-integration-tests
run: mvn -B verify -Dccm.version=${{ steps.scylla-version.outputs.value }} -Dccm.scylla=true -Dfmt.skip=true -Dclirr.skip=true -Danimal.sniffer.skip=true
- name: Copy test results
if: steps.run-integration-tests.outcome == 'failure'
run: |
shopt -s globstar
mkdir scylla-${{ matrix.scylla-version }}
cp --parents ./**/target/*-reports/*.xml scylla-${{ matrix.scylla-version }}/
- name: Upload test results
uses: actions/upload-artifact@v4
if: steps.run-integration-tests.outcome == 'failure'
with:
name: test-results-${{ matrix.java-version }}-${{ matrix.scylla-version }}
path: "*/**/target/*-reports/*.xml"
- name: Upload CCM logs
uses: actions/upload-artifact@v4
if: failure()
with:
name: ccm-log-scylla-${{ matrix.java-version }}-${{ matrix.scylla-version }}
path: /tmp/ccm*/ccm*/node*/logs/*