Skip to content

Test Server Backwards Compatibility #177

Test Server Backwards Compatibility

Test Server Backwards Compatibility #177

name: Test Server Backwards Compatibility
on:
workflow_dispatch:
inputs:
organization_name:
description: Name of the organization to build JARs from. If you want to run the tests with the JARs from your fork, set this to your username.
required: true
default: hazelcast
branch_name:
description: Name of the branch to build JARs from
required: true
default: master
hz_version:
description: Version of the JARs that will be built, without the SNAPSHOT suffix.
required: true
default: "5.0"
run_python:
description: Whether or not to run Python client tests. Set to something else to not run the tests.
required: true
default: run
run_nodejs:
description: Whether or not to run Node.js client tests (not supported client). Set to "run" to run the tests.
required: true
default: dontrun
run_cpp:
description: Whether or not to run CPP client tests (not supported client). Set to "run" to run the tests.
required: true
default: dontrun
run_csharp:
description: Whether or not to run Csharp client tests. Set to something else to not run the tests.
required: true
default: run
run_go:
description: Whether or not to run Go client tests (not supported client). Set to "run" to run the tests.
required: true
default: dontrun
run_java:
description: Whether or not to run Java Thin client tests. Set to something else to not run the tests.
required: true
default: run
jobs:
upload_jars:
name: Create and upload JARs
runs-on: ubuntu-latest
outputs:
hz_server_version: ${{ steps.set_up_hz_server_version.outputs.HAZELCAST_SERVER_VERSION }}
steps:
- name: Checkout to scripts
uses: actions/checkout@v4
with:
path: master
- name: Read Java Config
run: cat ${{ github.workspace }}/master/.github/java-config.env >> $GITHUB_ENV
- name: Setup Java
uses: actions/setup-java@v4
with:
java-version: ${{ env.JAVA_VERSION }}
distribution: ${{ env.JAVA_DISTRIBUTION }}
- name: Checkout to test artifacts
uses: actions/checkout@v4
with:
repository: hazelcast/private-test-artifacts
path: certs
ref: data
token: ${{ secrets.GH_PAT }}
- name: Checkout to Hazelcast Mono ${{ github.event.inputs.branch_name }}
uses: actions/checkout@v4
with:
repository: ${{ github.event.inputs.organization_name }}/hazelcast-mono
path: hazelcast-mono
ref: ${{ github.event.inputs.branch_name }}
token: ${{ secrets.GH_PAT }}
- name: Set up HAZELCAST_SERVER_VERSION output variable
id: set_up_hz_server_version
run: echo "HAZELCAST_SERVER_VERSION=$( mvn help:evaluate -Dexpression=project.version -q -DforceStdout )" >> "$GITHUB_OUTPUT"
working-directory: hazelcast-mono
- name: Build JARs Hazelcast Server Version ${{ steps.set_up_hz_server_version.outputs.HAZELCAST_SERVER_VERSION }}
run: ./mvnw clean install --activate-profiles quick
working-directory: hazelcast-mono
- name: Upload Hazelcast JAR
uses: actions/upload-artifact@v4
with:
name: hazelcast
path: hazelcast-mono/hazelcast/hazelcast/target/hazelcast-*[!s].jar
retention-days: 1
- name: Upload Hazelcast SQL JAR (if exists)
uses: actions/upload-artifact@v4
with:
name: hazelcast-sql
path: hazelcast-mono/hazelcast/hazelcast-sql/target/hazelcast-sql-*[!s].jar
if-no-files-found: ignore
retention-days: 1
- name: Upload Hazelcast tests JAR
uses: actions/upload-artifact@v4
with:
name: hazelcast-tests
path: hazelcast-mono/hazelcast/hazelcast/target/hazelcast-*-tests.jar
retention-days: 1
- name: Upload Hazelcast Enterprise JAR
uses: actions/upload-artifact@v4
with:
name: hazelcast-enterprise
path: hazelcast-mono/hazelcast-enterprise/target/hazelcast-enterprise-*[!s].jar
retention-days: 1
- name: Rename certs.jar as Hazelcast Enterprise tests JAR
run: |
HZ_TESTS_JAR_NAME=$(basename $(ls $GITHUB_WORKSPACE/hazelcast-mono/hazelcast/hazelcast/target/hazelcast-*-tests.jar))
HZ_ENTERPRISE_TESTS_JAR_NAME=$(echo $HZ_TESTS_JAR_NAME | sed "s/hazelcast/hazelcast-enterprise/")
mv certs.jar $HZ_ENTERPRISE_TESTS_JAR_NAME
working-directory: certs
- name: Upload certificates as Hazelcast Enterprise tests JAR
uses: actions/upload-artifact@v4
with:
name: hazelcast-enterprise-tests
path: certs/hazelcast-enterprise-*-tests.jar
retention-days: 1
setup_python_client_matrix:
name: Setup the Python client test matrix
if: ${{ github.event.inputs.run_python == 'run' }}
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
steps:
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: 3.9
- name: Checkout to scripts
uses: actions/checkout@v4
- name: Set client matrix
id: set-matrix
run: echo "::set-output name=matrix::$( python get_client_matrix.py --client py --option tag --use-latest-patch-versions )"
test_python_clients:
needs: [ upload_jars, setup_python_client_matrix ]
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
client_tag: ${{ fromJson(needs.setup_python_client_matrix.outputs.matrix) }}
server_kind: [ os, enterprise ]
name: Test Python client ${{ matrix.client_tag }} with ${{ matrix.server_kind }} server
steps:
- name: Set up enterprise license key
if: ${{ github.event.inputs.hz_version < '5.5' }}
run: |
echo "HAZELCAST_ENTERPRISE_KEY=${{ secrets.HAZELCAST_ENTERPRISE_KEY }}" >> $GITHUB_ENV
- name: Set up enterprise v7 license key
if: ${{ github.event.inputs.hz_version >= '5.5' }}
run: |
echo "HAZELCAST_ENTERPRISE_KEY=${{ secrets.HAZELCAST_ENTERPRISE_KEY_V7 }}" >> $GITHUB_ENV
- name: Checkout to scripts
uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: 3.9
- name: Read Java Config
run: cat ${{ github.workspace }}/.github/java-config.env >> $GITHUB_ENV
- name: Setup Java
uses: actions/setup-java@v4
with:
java-version: ${{ env.JAVA_VERSION }}
distribution: ${{ env.JAVA_DISTRIBUTION }}
- name: Checkout to master
uses: actions/checkout@v4
with:
repository: hazelcast/hazelcast-python-client
path: master
ref: master
- name: Checkout to tag
uses: actions/checkout@v4
with:
repository: hazelcast/hazelcast-python-client
path: tag
ref: ${{ matrix.client_tag }}
- name: Copy the client code into master
run: |
rm -rf $GITHUB_WORKSPACE/master/hazelcast
cp -a $GITHUB_WORKSPACE/tag/hazelcast $GITHUB_WORKSPACE/master/hazelcast
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements-test.txt
working-directory: master
- name: Download Hazelcast tests JAR
uses: actions/download-artifact@v4
with:
name: hazelcast-tests
path: jars
- name: Download Hazelcast SQL JAR (if exists)
continue-on-error: true
uses: actions/download-artifact@v4
with:
name: hazelcast-sql
path: jars
- name: Download Hazelcast JAR
if: ${{ matrix.server_kind == 'os' }}
uses: actions/download-artifact@v4
with:
name: hazelcast
path: jars
- name: Download Hazelcast Enterprise JAR
if: ${{ matrix.server_kind == 'enterprise' }}
uses: actions/download-artifact@v4
with:
name: hazelcast-enterprise
path: jars
- name: Download Hazelcast Enterprise tests JAR
if: ${{ matrix.server_kind == 'enterprise' }}
uses: actions/download-artifact@v4
with:
name: hazelcast-enterprise-tests
path: jars
- name: Start RC
env:
HAZELCAST_ENTERPRISE_KEY: ${{ env.HAZELCAST_ENTERPRISE_KEY }}
run: python start_rc.py --rc-version '0.8-SNAPSHOT' --jars jars --server-kind ${{ matrix.server_kind }} --use-simple-server
- name: Run non-enterprise tests
if: ${{ matrix.server_kind == 'os' }}
run: pytest -m 'not enterprise' tests/integration/backward_compatible
working-directory: master
- name: Run all tests
if: ${{ matrix.server_kind == 'enterprise' }}
run: pytest tests/integration/backward_compatible
working-directory: master
setup_nodejs_client_matrix:
name: Setup the Node.js client test matrix
if: ${{ github.event.inputs.run_nodejs == 'run' }}
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
steps:
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: 3.9
- name: Checkout to scripts
uses: actions/checkout@v4
- name: Set client matrix
id: set-matrix
run: echo "::set-output name=matrix::$( python get_client_matrix.py --client node --option tag --use-latest-patch-versions )"
test_nodejs_clients:
needs: [ upload_jars, setup_nodejs_client_matrix ]
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
client_tag: ${{ fromJson(needs.setup_nodejs_client_matrix.outputs.matrix) }}
server_kind: [ os, enterprise ]
name: Test Node.js client ${{ matrix.client_tag }} with ${{ matrix.server_kind }} server
steps:
- name: Set up enterprise license key
if: ${{ github.event.inputs.hz_version < '5.5' }}
run: |
echo "HAZELCAST_ENTERPRISE_KEY=${{ secrets.HAZELCAST_ENTERPRISE_KEY }}" >> $GITHUB_ENV
- name: Set up enterprise v7 license key
if: ${{ github.event.inputs.hz_version >= '5.5' }}
run: |
echo "HAZELCAST_ENTERPRISE_KEY=${{ secrets.HAZELCAST_ENTERPRISE_KEY_V7 }}" >> $GITHUB_ENV
- uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: 3.9
- name: Setup Node.js
uses: actions/setup-node@v2
with:
node-version: 14
- name: Read Java Config
run: cat ${{ github.workspace }}/.github/java-config.env >> $GITHUB_ENV
- name: Setup Java
uses: actions/setup-java@v4
with:
java-version: ${{ env.JAVA_VERSION }}
distribution: ${{ env.JAVA_DISTRIBUTION }}
- name: Checkout to master
uses: actions/checkout@v4
with:
repository: hazelcast/hazelcast-nodejs-client
path: master
ref: master
- name: Checkout to tag
uses: actions/checkout@v4
with:
repository: hazelcast/hazelcast-nodejs-client
path: tag
ref: ${{ matrix.client_tag }}
- name: Install dependencies and compile client
run: |
npm install
npm run compile
working-directory: tag
- name: Install test dependencies
run: |
npm install
working-directory: master
- name: Copy client code into master
run: |
rm -rf $GITHUB_WORKSPACE/master/lib
rm $GITHUB_WORKSPACE/master/package.json
cp -a $GITHUB_WORKSPACE/tag/lib $GITHUB_WORKSPACE/master/lib
cp -a $GITHUB_WORKSPACE/tag/package.json $GITHUB_WORKSPACE/master/package.json
- name: Download Hazelcast tests JAR
uses: actions/download-artifact@v4
with:
name: hazelcast-tests
path: jars
- name: Download Hazelcast SQL JAR (if exists)
continue-on-error: true
uses: actions/download-artifact@v4
with:
name: hazelcast-sql
path: jars
- name: Download Hazelcast JAR
if: ${{ matrix.server_kind == 'os' }}
uses: actions/download-artifact@v4
with:
name: hazelcast
path: jars
- name: Download Hazelcast Enterprise JAR
if: ${{ matrix.server_kind == 'enterprise' }}
uses: actions/download-artifact@v4
with:
name: hazelcast-enterprise
path: jars
- name: Download Hazelcast Enterprise tests JAR
if: ${{ matrix.server_kind == 'enterprise' }}
uses: actions/download-artifact@v4
with:
name: hazelcast-enterprise-tests
path: jars
- name: Start RC
env:
HAZELCAST_ENTERPRISE_KEY: ${{ env.HAZELCAST_ENTERPRISE_KEY }}
run: python start_rc.py --rc-version '0.8-SNAPSHOT' --jars jars --server-kind ${{ matrix.server_kind }}
- name: Run non-enterprise tests
if: ${{ matrix.server_kind == 'os' }}
run: node node_modules/mocha/bin/mocha --recursive test/integration/backward_compatible
working-directory: master
- name: Run all tests
if: ${{ matrix.server_kind == 'enterprise' }}
run: node node_modules/mocha/bin/mocha --recursive test/integration/backward_compatible
working-directory: master
env:
HAZELCAST_ENTERPRISE_KEY: ${{ env.HAZELCAST_ENTERPRISE_KEY }}
setup_csharp_client_matrix:
name: Setup the Csharp client test matrix
if: ${{ github.event.inputs.run_csharp == 'run' }}
runs-on: windows-latest
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
steps:
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: 3.9
- name: Checkout to scripts
uses: actions/checkout@v4
- name: Set client matrix
id: set-matrix
run: echo "::set-output name=matrix::$( python get_client_matrix.py --client cs --option tag --use-latest-patch-versions )"
test_csharp_clients:
needs: [ upload_jars, setup_csharp_client_matrix ]
runs-on: windows-latest
strategy:
fail-fast: false
matrix:
client_tag: ${{ fromJson(needs.setup_csharp_client_matrix.outputs.matrix) }}
server_kind: [ os, enterprise ]
name: Test Csharp client ${{ matrix.client_tag }} with ${{ matrix.server_kind }} server
steps:
- name: Set up enterprise license key
if: ${{ github.event.inputs.hz_version < '5.5' }}
run: |
echo "HAZELCAST_ENTERPRISE_KEY=${{ secrets.HAZELCAST_ENTERPRISE_KEY }}" >> $GITHUB_ENV
- name: Set up enterprise v7 license key
if: ${{ github.event.inputs.hz_version >= '5.5' }}
run: |
echo "HAZELCAST_ENTERPRISE_KEY=${{ secrets.HAZELCAST_ENTERPRISE_KEY_V7 }}" >> $GITHUB_ENV
- uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: 3.9
- name: Read Java Config
uses: pietrobolcato/action-read-yaml@9f13718d61111b69f30ab4ac683e67a56d254e1d
id: java-config
with:
config: ${{ github.workspace }}/.github/java-config.yml
- name: Setup Java
uses: actions/setup-java@v4
with:
java-version: ${{ steps.java-config.outputs['java-version'] }}
distribution: ${{ steps.java-config.outputs['distribution'] }}
- name: Install .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: |
2.1.x
3.1.x
5.0.x
6.0.x
7.0.x
8.0.x
- name: Checkout to tag
uses: actions/checkout@v4
with:
repository: hazelcast/hazelcast-csharp-client
path: tag
ref: ${{ matrix.client_tag }}
- name: Checkout default branch
uses: actions/checkout@v4
with:
repository: hazelcast/hazelcast-csharp-client
path: hazelcast-csharp-client-master
sparse-checkout: |
hz.ps1
build/utils.ps1
sparse-checkout-cone-mode: false
- name: Download Hazelcast tests JAR
uses: actions/download-artifact@v4
with:
name: hazelcast-tests
path: tag/temp/lib
- name: Download Hazelcast SQL JAR (if exists)
continue-on-error: true
uses: actions/download-artifact@v4
with:
name: hazelcast-sql
path: tag/temp/lib
- name: Download Hazelcast JAR
if: ${{ matrix.server_kind == 'os' }}
uses: actions/download-artifact@v4
with:
name: hazelcast
path: tag/temp/lib
- name: Download Hazelcast Enterprise JAR
if: ${{ matrix.server_kind == 'enterprise' }}
uses: actions/download-artifact@v4
with:
name: hazelcast-enterprise
path: tag/temp/lib
- name: Download Hazelcast Enterprise tests JAR
if: ${{ matrix.server_kind == 'enterprise' }}
uses: actions/download-artifact@v4
with:
name: hazelcast-enterprise-tests
path: tag/temp/lib
- name: Update submodules
run: |
git submodule update --init
working-directory: tag
- name: Detect Client Version
shell: pwsh
run: |
$client = "${{matrix.client_tag}}".replace("v","")
"CLIENT_VERSION=$client" >> $env:GITHUB_ENV
- uses: madhead/semver-utils@latest
id: version
with:
version: ${{ env.CLIENT_VERSION }}
compare-to: 5.2.x
satisfies: x
- name: Client Version
run: |
echo "${{steps.version.outputs.major}}.${{steps.version.outputs.minor }}.${{steps.version.outputs.patch }}"
- name: Copy latest build scripts to local workspace
shell: pwsh
run: |
# This is only currently required for <5.5.0 clients, where the location of the OS SNAPSHOT repo needs to be provided
# However, for consistency they should always be used and therefore must be kept in sync, as there are guaranteed to be further future breaking changes
cp hazelcast-csharp-client-master\hz.ps1 ${{github.workspace}}\tag\hz.ps1
cp hazelcast-csharp-client-master\build\utils.ps1 ${{github.workspace}}\tag\build\utils.ps1
- name: Backport SSL Tests
id: backport-tests
if: ${{ ((steps.version.outputs.major == '5' && steps.version.outputs.minor < '3') || (steps.version.outputs.major == '4')) }}
shell: pwsh
working-directory: tag
run: |
./hz.ps1 copy-files -copy-files-source ${{github.workspace}}\utils\net\ssl
- name: Upgrade NUnit Adapter in Testing if Client v5.2.2 or v5.3.1
id: upgrade-nunit-adapter
if: ${{ ((steps.version.outputs.major == '5' && steps.version.outputs.minor == '3' && steps.version.outputs.patch == '1') || (steps.version.outputs.major == '5' && steps.version.outputs.minor == '2' && steps.version.outputs.patch == '2')) }}
working-directory: tag
run: |
sed -i 's/<PackageReference Include="NUnit3TestAdapter" Version="4.3.1">/<PackageReference Include="NUnit3TestAdapter" Version="4.5.0">/g' src/Hazelcast.Net.Tests/Hazelcast.Net.Tests.csproj
- name: Build
shell: pwsh
working-directory: tag
run: |
./hz.ps1 clean, build
- name: Build Client 4.0.2 with compatibility
if: ${{ steps.version.outputs.major == '4' && steps.version.outputs.minor == '0' }}
shell: pwsh
working-directory: tag
run: |
./hz.ps1 clean, build
- name: Run non-enterprise tests
if: ${{ matrix.server_kind == 'os' && steps.backport-tests.outcome == 'skipped' }}
shell: pwsh
run: |
./hz.ps1 test -tf "method != SendReceive and namespace !~ Hazelcast.Tests.CP" -server ${{ github.event.inputs.hz_version }}-SNAPSHOT
working-directory: tag
env:
HAZELCAST_SERVER_VERSION: ${{ github.event.inputs.hz_version }}
HZ_SNAPSHOT_INTERNAL_USERNAME: ${{ secrets.HZ_SNAPSHOT_INTERNAL_USERNAME }}
HZ_SNAPSHOT_INTERNAL_PASSWORD: ${{ secrets.HZ_SNAPSHOT_INTERNAL_PASSWORD }}
- name: Run non-enterprise tests with compatibility
if: ${{ matrix.server_kind == 'os' && steps.backport-tests.outcome == 'success' }}
shell: pwsh
run: |
./hz.ps1 test -tf "method != SendReceive and namespace !~ Hazelcast.Tests.CP" -server ${{ github.event.inputs.hz_version }}-SNAPSHOT
working-directory: tag
env:
HAZELCAST_SERVER_VERSION: ${{ github.event.inputs.hz_version }}
HZ_SNAPSHOT_INTERNAL_USERNAME: ${{ secrets.HZ_SNAPSHOT_INTERNAL_USERNAME }}
HZ_SNAPSHOT_INTERNAL_PASSWORD: ${{ secrets.HZ_SNAPSHOT_INTERNAL_PASSWORD }}
- name: Run all tests
if: ${{ matrix.server_kind == 'enterprise' && steps.backport-tests.outcome == 'skipped' }}
shell: pwsh
run: |
./hz.ps1 -enterprise -tf "method != SendReceive" -server ${{ github.event.inputs.hz_version }}-SNAPSHOT test ${{ secrets.GH_PAT }}
working-directory: tag
env:
HAZELCAST_ENTERPRISE_KEY: ${{ secrets.HAZELCAST_ENTERPRISE_KEY_V7 }}
HAZELCAST_SERVER_VERSION: ${{ github.event.inputs.hz_version }}
HZ_SNAPSHOT_INTERNAL_USERNAME: ${{ secrets.HZ_SNAPSHOT_INTERNAL_USERNAME }}
HZ_SNAPSHOT_INTERNAL_PASSWORD: ${{ secrets.HZ_SNAPSHOT_INTERNAL_PASSWORD }}
- name: Run all tests with compatibility
if: ${{matrix.server_kind == 'enterprise' && steps.backport-tests.outcome == 'success'}}
shell: pwsh
run: |
./hz.ps1 -enterprise -tf "method != SendReceive" -server ${{ github.event.inputs.hz_version }}-SNAPSHOT test ${{ secrets.GH_PAT }}
working-directory: tag
env:
HAZELCAST_ENTERPRISE_KEY: ${{ secrets.HAZELCAST_ENTERPRISE_KEY_V7 }}
HAZELCAST_SERVER_VERSION: ${{ github.event.inputs.hz_version }}
HZ_SNAPSHOT_INTERNAL_USERNAME: ${{ secrets.HZ_SNAPSHOT_INTERNAL_USERNAME }}
HZ_SNAPSHOT_INTERNAL_PASSWORD: ${{ secrets.HZ_SNAPSHOT_INTERNAL_PASSWORD }}
# upload logs
- name: Upload RC and Server logs
uses: actions/upload-artifact@v4
if: always()
with:
name: Rc-Server-logs-${{ matrix.client_tag }}-${{ matrix.server_kind }}
path: '${{github.workspace}}\tag\temp\rc\' # entire directory
setup_cpp_client_matrix:
name: Setup the Cpp client test matrix
if: ${{ github.event.inputs.run_cpp == 'run' }}
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
steps:
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: 3.9
- name: Checkout to scripts
uses: actions/checkout@v4
- name: Set client matrix
id: set-matrix
run: echo "::set-output name=matrix::$( python get_client_matrix.py --client cpp --option tag --use-latest-patch-versions )"
test_cpp_clients:
needs: [ upload_jars, setup_cpp_client_matrix ]
runs-on: ubuntu-20.04
strategy:
fail-fast: false
matrix:
client_tag: ${{ fromJson(needs.setup_cpp_client_matrix.outputs.matrix) }}
server_kind: [ enterprise ] #TODO When tests are divided as OS, ENTERPRISE, OS matrix will be added
name: Test CPP client ${{ matrix.client_tag }} with ${{ matrix.server_kind }} server
steps:
- name: Set up enterprise license key
if: ${{ github.event.inputs.hz_version < '5.5' }}
run: |
echo "HAZELCAST_ENTERPRISE_KEY=${{ secrets.HAZELCAST_ENTERPRISE_KEY }}" >> $GITHUB_ENV
- name: Set up enterprise v7 license key
if: ${{ github.event.inputs.hz_version >= '5.5' }}
run: |
echo "HAZELCAST_ENTERPRISE_KEY=${{ secrets.HAZELCAST_ENTERPRISE_KEY_V7 }}" >> $GITHUB_ENV
- uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: 3.9
- name: Read Java Config
run: cat ${{ github.workspace }}/.github/java-config.env >> $GITHUB_ENV
- name: Setup Java
uses: actions/setup-java@v4
with:
java-version: ${{ env.JAVA_VERSION }}
distribution: ${{ env.JAVA_DISTRIBUTION }}
- name: Checkout master
uses: actions/checkout@v4
with:
repository: hazelcast/hazelcast-cpp-client
path: master
- name: Checkout to tag
uses: actions/checkout@v4
with:
repository: hazelcast/hazelcast-cpp-client
path: tag
ref: ${{ matrix.client_tag }}
- name: Delete old scripts and get new ones
run: |
rm -rf tag/scripts
cp -R master/scripts tag/
- name: Install Necessary Packages
run: |
sudo apt-get update
sudo apt-get install -y net-tools libssl-dev gdb
working-directory: tag
- name: Install Boost
run: |
sudo ./scripts/install-boost.sh 1.76.0
working-directory: tag
- name: Install Thrift
run: |
sudo ./scripts/install-thrift.sh 0.13.0
working-directory: tag
- name: Download Hazelcast tests JAR
uses: actions/download-artifact@v4
with:
name: hazelcast-tests
path: tag
- name: Download Hazelcast SQL JAR (if exists)
continue-on-error: true
uses: actions/download-artifact@v4
with:
name: hazelcast-sql
path: tag
- name: Download Hazelcast JAR
if: ${{ matrix.server_kind == 'os' }}
uses: actions/download-artifact@v4
with:
name: hazelcast
path: tag
- name: Download Hazelcast Enterprise JAR
if: ${{ matrix.server_kind == 'enterprise' }}
uses: actions/download-artifact@v4
with:
name: hazelcast-enterprise
path: tag
- name: Download Hazelcast Enterprise tests JAR
if: ${{ matrix.server_kind == 'enterprise' }}
uses: actions/download-artifact@v4
with:
name: hazelcast-enterprise-tests
path: tag
- name: Build & Install
env:
BUILD_DIR: build
run: |
./scripts/build-unix.sh \
-DCMAKE_BUILD_TYPE=Debug \
-DBUILD_SHARED_LIBS=ON \
-DWITH_OPENSSL=ON \
-DBUILD_TESTS=ON \
-DBUILD_EXAMPLES=OFF
working-directory: tag
- name: Test
env:
BUILD_DIR: build
HAZELCAST_ENTERPRISE_KEY: ${{ env.HAZELCAST_ENTERPRISE_KEY }}
GTEST_FILTER: -*Aws*:*DescribeInstancesTest*
HZ_VERSION: '${{ github.event.inputs.hz_version }}-SNAPSHOT'
run: |
ulimit -c unlimited
sudo sh -c "echo 'core' > /proc/sys/kernel/core_pattern"
sudo sh -c "echo '1' > /proc/sys/kernel/core_uses_pid"
./scripts/test-unix.sh
working-directory: tag
setup_go_client_matrix:
name: Setup the Go client test matrix
if: ${{ github.event.inputs.run_go == 'run' }}
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
steps:
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: 3.9
- name: Checkout to scripts
uses: actions/checkout@v4
- name: Set client matrix
id: set-matrix
run: echo "::set-output name=matrix::$( python get_client_matrix.py --client go --option tag --use-latest-patch-versions )"
test_go_client:
needs: [upload_jars, setup_go_client_matrix]
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
client_tag: ${{ fromJson(needs.setup_go_client_matrix.outputs.matrix) }}
name: Test Go client ${{ matrix.client_tag }} with enterprise server on ubuntu-latest
steps:
- name: Set up enterprise license key
if: ${{ github.event.inputs.hz_version < '5.5' }}
run: |
echo "HAZELCAST_ENTERPRISE_KEY=${{ secrets.HAZELCAST_ENTERPRISE_KEY }}" >> $GITHUB_ENV
- name: Set up enterprise v7 license key
if: ${{ github.event.inputs.hz_version >= '5.5' }}
run: |
echo "HAZELCAST_ENTERPRISE_KEY=${{ secrets.HAZELCAST_ENTERPRISE_KEY_V7 }}" >> $GITHUB_ENV
- uses: actions/checkout@v4
- name: Read Java Config
run: cat ${{ github.workspace }}/.github/java-config.env >> $GITHUB_ENV
- name: Setup Java
uses: actions/setup-java@v4
with:
java-version: ${{ env.JAVA_VERSION }}
distribution: ${{ env.JAVA_DISTRIBUTION }}
- name: Checkout the ${{ matrix.client_tag }}
uses: actions/checkout@v4
with:
repository: hazelcast/hazelcast-go-client
path: client
ref: ${{ matrix.client_tag }}
- name: Download Hazelcast tests JAR
uses: actions/download-artifact@v4
with:
name: hazelcast-tests
path: client
- name: Download Hazelcast JAR
uses: actions/download-artifact@v4
with:
name: hazelcast
path: client
- name: Download Hazelcast SQL JAR (if exists)
continue-on-error: true
uses: actions/download-artifact@v4
with:
name: hazelcast-sql
path: client
- name: Download Hazelcast Enterprise JAR
uses: actions/download-artifact@v4
with:
name: hazelcast-enterprise
path: client
- name: Download Hazelcast Enterprise tests JAR
uses: actions/download-artifact@v4
with:
name: hazelcast-enterprise-tests
path: client
- name: Test
env:
HAZELCAST_ENTERPRISE_KEY: ${{ env.HAZELCAST_ENTERPRISE_KEY }}
HZ_VERSION: '${{ github.event.inputs.hz_version }}-SNAPSHOT'
SSL_ENABLED: 1
run: |
./rc.sh start
make test-all
working-directory: client
setup_java_client_matrix:
name: Setup the Java Thin client test matrix
if: ${{ github.event.inputs.run_java == 'run' }}
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
steps:
- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: 3.9
- name: Checkout to scripts
uses: actions/checkout@v4
- name: Set client matrix
id: set-matrix
#run: echo "matrix=$( python get_client_matrix.py --client java --option tag --use-latest-patch-versions )" >> "$GITHUB_OUTPUT"
run: echo 'matrix=["v5.5.0"]' >> "$GITHUB_OUTPUT"
test_java_client:
needs: [ upload_jars, setup_java_client_matrix ]
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
client_tag: ${{ fromJson(needs.setup_java_client_matrix.outputs.matrix) }}
server_kind: [ os, enterprise ]
name: Test Java Thin client ${{ matrix.client_tag }} with ${{ matrix.server_kind }} server
steps:
- name: Set up enterprise license key
if: ${{ github.event.inputs.hz_version < '5.5' }}
run: |
echo "HAZELCAST_ENTERPRISE_KEY=${{ secrets.HAZELCAST_ENTERPRISE_KEY }}" >> $GITHUB_ENV
- name: Set up enterprise v7 license key
if: ${{ github.event.inputs.hz_version >= '5.5' }}
run: |
echo "HAZELCAST_ENTERPRISE_KEY=${{ secrets.HAZELCAST_ENTERPRISE_KEY_V7 }}" >> $GITHUB_ENV
- uses: actions/checkout@v4
- name: Read Java Config
run: cat ${{ github.workspace }}/.github/java-config.env >> $GITHUB_ENV
- name: Setup Java
uses: actions/setup-java@v4
with:
java-version: ${{ env.JAVA_VERSION }}
distribution: ${{ env.JAVA_DISTRIBUTION }}
- name: Checkout to ${{ matrix.client_tag }}
uses: actions/checkout@v4
with:
repository: ${{ github.event.inputs.organization_name }}/hazelcast-java-client
token: ${{ secrets.GH_PAT }}
path: java-client
ref: ${{ matrix.client_tag }}
- name: Setup Local Maven Cache
uses: actions/cache@v4
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: Remove ${{ needs.upload_jars.outputs.hz_server_version }} dir from Local Maven Cache
run: |
rm -rf ~/.m2/repository/com/hazelcast/hazelcast/${{ needs.upload_jars.outputs.hz_server_version }}
rm -rf ~/.m2/repository/com/hazelcast/hazelcast-enterprise/${{ needs.upload_jars.outputs.hz_server_version }}
- name: Download Hazelcast JAR
uses: actions/download-artifact@v4
with:
name: hazelcast
path: hazelcast-server-jars
- name: Download Hazelcast tests JAR
uses: actions/download-artifact@v4
with:
name: hazelcast-tests
path: hazelcast-server-jars
- name: Download Hazelcast Enterprise JAR
uses: actions/download-artifact@v4
with:
name: hazelcast-enterprise
path: hazelcast-server-jars
- name: Install Hazelcast JAR to maven local
run: |
mvn -B install:install-file\
-Dfile=hazelcast-server-jars/hazelcast-${{ needs.upload_jars.outputs.hz_server_version }}.jar\
-DgroupId=com.hazelcast\
-DartifactId=hazelcast\
-Dversion=${{ needs.upload_jars.outputs.hz_server_version }}\
-Dpackaging=jar\
-DgeneratePom=true
- name: Install Hazelcast tests JAR to maven local
run: |
mvn -B install:install-file\
-Dfile=hazelcast-server-jars/hazelcast-${{ needs.upload_jars.outputs.hz_server_version }}-tests.jar\
-DgroupId=com.hazelcast\
-DartifactId=hazelcast\
-Dversion=${{ needs.upload_jars.outputs.hz_server_version }}\
-Dclassifier=tests\
-Dpackaging=jar\
-DgeneratePom=true
- name: Install Hazelcast Enterprise JAR to maven local
run: |
mvn -B install:install-file\
-Dfile=hazelcast-server-jars/hazelcast-enterprise-${{ needs.upload_jars.outputs.hz_server_version }}.jar\
-DgroupId=com.hazelcast\
-DartifactId=hazelcast-enterprise\
-Dversion=${{ needs.upload_jars.outputs.hz_server_version }}\
-Dpackaging=jar\
-DgeneratePom=true
- name: Set up HZ_LICENSEKEY env
if: ${{ matrix.server_kind == 'enterprise' && needs.upload_jars.outputs.hz_server_version < '5.5' }}
run: |
echo "HZ_LICENSEKEY=${{ secrets.HAZELCAST_ENTERPRISE_KEY }}" >> $GITHUB_ENV
- name: Set up v7 HZ_LICENSEKEY env
if: ${{ matrix.server_kind == 'enterprise' && needs.upload_jars.outputs.hz_server_version >= '5.5' }}
run: |
echo "HZ_LICENSEKEY=${{ secrets.HAZELCAST_ENTERPRISE_KEY_V7 }}" >> $GITHUB_ENV
- name: Run non-enterprise tests
run: |
chmod +x mvnw
./mvnw -B -V -e install -Pintegration-tests -Pcode-coverage -Djdk.version=${{ env.JAVA_VERSION }} -Dtest.hazelcast-server.version=${{ needs.upload_jars.outputs.hz_server_version }}
working-directory: java-client/hazelcast-java-client
- name: Run enterprise tests
if: ${{ matrix.server_kind == 'enterprise' }}
shell: bash -l {0}
run: |
chmod +x mvnw
./mvnw -B -V -e test -Pintegration-tests -Pcode-coverage -Djdk.version=${{ env.JAVA_VERSION }} -Dtest.hazelcast-server.version=${{ needs.upload_jars.outputs.hz_server_version }}
working-directory: java-client/hazelcast-enterprise-java-client