-
Notifications
You must be signed in to change notification settings - Fork 17
Expand file tree
/
Copy pathpython_client_compatibility.yaml
More file actions
133 lines (116 loc) · 4.87 KB
/
Copy pathpython_client_compatibility.yaml
File metadata and controls
133 lines (116 loc) · 4.87 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
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:
uses: ./.github/workflows/get-server-matrix.yaml
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@v6
- name: Checkout to test artifacts
if: ${{ matrix.kind == 'enterprise' }}
uses: actions/checkout@v6
with:
repository: hazelcast/private-test-artifacts
path: certs
ref: data
token: ${{ secrets.GH_PAT }}
- name: Setup Python
uses: actions/setup-python@v6
with:
python-version: 3.11
- name: Read Java Config
run: cat ${GITHUB_WORKSPACE}/.github/java-config.env >> $GITHUB_ENV
- name: Setup Java
uses: actions/setup-java@v5
with:
java-version: ${{ env.JAVA_VERSION }}
distribution: ${{ env.JAVA_DISTRIBUTION }}
- name: Checkout to master
uses: actions/checkout@v6
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@v6
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: Create the test jar with certificates
if: ${{ matrix.kind == 'enterprise' }}
working-directory: certs
run: |
zip -r -j certs.jar $GITHUB_WORKSPACE/master/tests/integration/backward_compatible/ssl_tests/hostname_verification/*.p12
cp certs.jar ../hazelcast-enterprise-${{ matrix.version }}-tests.jar
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements-test.txt
working-directory: master
- uses: ./.github/actions/get-enterprise-license
id: get-enterprise-license
with:
hazelcast-version: ${{ matrix.version }}
- name: Convert major.minor version to semver
id: generate-semver
run: |
# `semver-utils` expects a fully qualified semver, but some older Python clients were major.minor (e.g. `v5.0`) which was unsupported
# In those cases, convert major.minor (e.g. `v5.0`) -> major.minor.patch (e.g. `v.5.0.0`)
VERSION="${{ github.event.inputs.branch_name }}"
if [[ "$VERSION" =~ ^v[0-9]+\.[0-9]+$ ]]; then
VERSION="${VERSION}.0"
fi
echo "version=${VERSION}" >> "${GITHUB_OUTPUT}"
# https://github.com/madhead/semver-utils/releases/tag/v4.3.0
- uses: madhead/semver-utils@36d1e0ed361bd7b4b77665de8093092eaeabe6ba
id: client-version
with:
version: ${{ steps.generate-semver.outputs.version }}
compare-to: 5.5.0
- name: Download RCD
shell: bash
run: |
wget -q https://client-rcd-download.s3.us-east-2.amazonaws.com/rcd-ubuntu-latest
- name: Run tests
env:
HZ_VERSION: ${{ matrix.version }}
HAZELCAST_ENTERPRISE_KEY: ${{ secrets[steps.get-enterprise-license.outputs.HAZELCAST_ENTERPRISE_KEY_SECRET] }}
run: |
chmod +x rcd-ubuntu-latest
./rcd-ubuntu-latest -version $HZ_VERSION &
# wait for a bit for RCD to download artifacts
sleep 10
args=(--verbose)
if [ "${{ matrix.kind }}" = "os" ]; then
args+=(-m "not enterprise")
fi
if [[ "${{ steps.client-version.outputs.comparison-result }}" = "<" ]]; then
# Workaround https://github.com/hazelcast/hazelcast-python-client/issues/666 by skipping those tests
args+=(--ignore master/tests/integration/backward_compatible/predicate_test.py)
args+=(--ignore master/tests/integration/asyncio/predicate_test.py)
fi
pytest master/tests/integration/asyncio master/tests/integration/backward_compatible "${args[@]}"