Skip to content

Test Python client against the released IMDG servers #19

Test Python client against the released IMDG servers

Test Python client against the released IMDG servers #19

name: Test Python client against the released IMDG servers
on:
workflow_dispatch:
inputs:
organization_name:
description: Default is hazelcast, but if you would like to run the workflow with your forked repo, set your github username
required: true
default: hazelcast
branch_name:
description: Name of the branch to test client from
required: true
default: master
jobs:
setup_server_matrix:
name: Setup the server test matrix
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 server matrix
id: set-matrix
run: echo "::set-output name=matrix::$( python get_server_matrix.py )"
test_client:
needs: [setup_server_matrix]
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
version: ${{ fromJson(needs.setup_server_matrix.outputs.matrix) }}
kind: [os, enterprise]
name: Test Python client against ${{ matrix.kind }} ${{ matrix.version }} server
steps:
- name: Checkout to scripts
uses: actions/checkout@v4
- name: Checkout to test artifacts
if: ${{ matrix.kind == 'enterprise' }}
uses: actions/checkout@v4
with:
repository: hazelcast/private-test-artifacts
path: certs
ref: data
token: ${{ secrets.GH_PAT }}
- 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: Download JARs
run: python download_server_jars.py --version ${{ matrix.version }} --server-kind ${{ matrix.kind }} --dst jars
- name: Copy certificates JAR to destination with the appropriate name
if: ${{ matrix.kind == 'enterprise' }}
run: |
cp $GITHUB_WORKSPACE/certs/certs.jar $GITHUB_WORKSPACE/jars/hazelcast-enterprise-${{ matrix.version }}-tests.jar
- name: Checkout to master
uses: actions/checkout@v4
with:
repository: ${{ github.event.inputs.organization_name }}/hazelcast-python-client
path: master
ref: master
- name: Checkout to ${{ github.event.inputs.branch_name }}
uses: actions/checkout@v4
with:
repository: ${{ github.event.inputs.organization_name }}/hazelcast-python-client
path: client
ref: ${{ github.event.inputs.branch_name }}
- name: Copy the client code into master
run: |
rm -rf $GITHUB_WORKSPACE/master/hazelcast
cp -a $GITHUB_WORKSPACE/client/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: Start RC
env:
HAZELCAST_ENTERPRISE_KEY: ${{ secrets.HAZELCAST_ENTERPRISE_KEY_V7 }}
run: python start_rc.py --rc-version '0.8-SNAPSHOT' --jars jars --server-kind ${{ matrix.kind }} --use-simple-server
- name: Run non-enterprise tests
if: ${{ matrix.kind == 'os' }}
run: pytest -m 'not enterprise' tests/integration/backward_compatible
working-directory: master
- name: Run all tests
if: ${{ matrix.kind == 'enterprise' }}
run: pytest tests/integration/backward_compatible
working-directory: master