-
Notifications
You must be signed in to change notification settings - Fork 18
255 lines (219 loc) · 12 KB
/
java_client_compatibility.yaml
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
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
name: Test Java 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
server_version:
description: Version of the server to test against
required: true
default: 5.5.0
tests_type:
description: Type of tests to run
required: true
default: 'OS'
type: choice
options:
- OS
- ENTERPRISE
jobs:
setup_test_filters_matrix:
name: Setup the test filters matrix
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.set-test-filters-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 test filters matrix
id: set-test-filters-matrix
run: echo "matrix=$( python get_java_client_test_filters_matrix.py --server-kind ${{ github.event.inputs.tests_type }} )" >> "$GITHUB_OUTPUT"
vector_tests:
if: ${{ github.event.inputs.tests_type == 'ENTERPRISE' }}
name: Test Java client ${{ github.event.inputs.branch_name }} branch running ${{ github.event.inputs.tests_type }} Vector tests against ENTERPRISE ${{ github.event.inputs.server_version }} server
runs-on: ubicloud-standard-8
steps:
- name: Checkout to scripts
uses: actions/checkout@v4
- name: Read Java Config
run: cat ${{ github.workspace }}/.github/java-config.env >> $GITHUB_ENV
- name: Setup Server Java
uses: actions/setup-java@v4
with:
java-version: ${{ env.JAVA_VERSION }}
distribution: ${{ env.JAVA_DISTRIBUTION }}
- name: Set Server JDK home
run: echo "SERVER_JAVA=$JAVA_HOME" >> $GITHUB_ENV
- name: Setup JDK8
uses: actions/setup-java@v4
with:
distribution: "zulu"
java-version: "8"
- name: Checkout to ${{ github.event.inputs.branch_name }}
uses: actions/checkout@v4
with:
repository: ${{ github.event.inputs.organization_name }}/hazelcast-java-client
token: ${{ secrets.GH_PAT }}
path: client
ref: ${{ github.event.inputs.branch_name }}
- 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: Check Server Version to Determine License Version
uses: madhead/semver-utils@latest
id: version
with:
version: ${{ github.event.inputs.server_version }}
compare-to: 5.3.0
- name: Set up HZ_LICENSEKEY env
run: |
echo "HZ_LICENSEKEY=${{ '>' == steps.version.outputs.comparison-result && secrets.HAZELCAST_ENTERPRISE_KEY || secrets.HAZELCAST_ENTERPRISE_KEY_V5 }}" >> $GITHUB_ENV
- name: Build modules
shell: bash -l {0}
run: |
chmod +x mvnw
JAVA_HOME=${{env.JAVA_HOME}} ./mvnw -B -V -e clean install -DskipTests -Dtest.hazelcast-server.version=${{ github.event.inputs.server_version }}
working-directory: client
- name: Run remote controller for enterprise tests
working-directory: client/hazelcast-enterprise-java-client/target/test-artifacts
run: |
${{env.SERVER_JAVA}}/bin/java -cp additional-libs/*:hazelcast-remote-controller.jar:../test-artifacts:hazelcast-enterprise.jar:hazelcast.jar:test-artifacts.jar:os-test-artifacts.jar:test-vector-artifacts.jar:test-os-vector-artifacts.jar:../test-classes/jars/testsubjects.jar:../test-classes/jars/test.jar: -Djava.security.krb5.conf=../../src/test/resources/krb5.conf -Dhazelcast.logging.details.enabled=true -Dhazelcast.hidensity.check.freememory=false --add-exports java.base/jdk.internal.ref=ALL-UNNAMED --add-opens jdk.management/com.sun.management.internal=ALL-UNNAMED --add-opens java.management/sun.management=ALL-UNNAMED --add-exports jdk.management/com.ibm.lang.management.internal=ALL-UNNAMED --add-opens java.base/java.nio=ALL-UNNAMED --add-opens java.base/sun.nio.ch=ALL-UNNAMED --add-opens java.base/java.lang=ALL-UNNAMED --add-opens java.base/java.lang.reflect=ALL-UNNAMED --add-opens java.base/java.util.concurrent=ALL-UNNAMED --add-opens java.base/java.util=ALL-UNNAMED com.hazelcast.remotecontroller.Main --use-simple-server 2> server_log.txt &
- name: Copy vector libs
run: |
cp client/hazelcast-enterprise-java-client-vector/target/test-artifacts/os-test-vector-artifacts.jar client/hazelcast-enterprise-java-client/target/test-artifacts/os-test-vector-artifacts.jar
cp client/hazelcast-enterprise-java-client-vector/target/test-artifacts/test-vector-artifacts.jar client/hazelcast-enterprise-java-client/target/test-artifacts/test-vector-artifacts.jar
- name: Run enterprise Vector tests
shell: bash -l {0}
run: |
chmod +x mvnw
JAVA_HOME=${{env.JAVA_HOME}} ./mvnw -B -V -e test -Pintegration-tests -Dtest.hazelcast-server.version=${{ github.event.inputs.server_version }}
working-directory: client/hazelcast-enterprise-java-client-vector
- name: Archive server logs
uses: actions/upload-artifact@v4
if: always()
with:
name: server-${{ github.event.inputs.server_version.server_version }}-ENTERPRISE-logs-tests-vector
path: |
client/hazelcast-enterprise-java-client/target/test-artifacts/server_log.txt
test_client:
needs: [setup_test_filters_matrix]
runs-on: ubicloud-standard-8
strategy:
fail-fast: false
matrix:
server_version:
- ${{ github.event.inputs.server_version }}
server_kind: [ ENTERPRISE ]
test_filter: ${{ fromJson(needs.setup_test_filters_matrix.outputs.matrix) }}
tests_type:
- ${{ github.event.inputs.tests_type }}
name: Test Java client ${{ github.event.inputs.branch_name }} branch (package ${{ matrix.test_filter }}) running ${{ matrix.test_type}} tests against ${{ matrix.server_kind }} ${{ matrix.server_version }} server
steps:
- name: Checkout to scripts
uses: actions/checkout@v4
- name: Read Java Config
run: cat ${{ github.workspace }}/.github/java-config.env >> $GITHUB_ENV
- name: Setup Server Java
uses: actions/setup-java@v4
with:
java-version: ${{ env.JAVA_VERSION }}
distribution: ${{ env.JAVA_DISTRIBUTION }}
- name: Set Server JDK home
run: echo "SERVER_JAVA=$JAVA_HOME" >> $GITHUB_ENV
- name: Setup JDK8
uses: actions/setup-java@v4
with:
distribution: "zulu"
java-version: "8"
- name: Checkout to ${{ github.event.inputs.branch_name }}
uses: actions/checkout@v4
with:
repository: ${{ github.event.inputs.organization_name }}/hazelcast-java-client
token: ${{ secrets.GH_PAT }}
path: client
ref: ${{ github.event.inputs.branch_name }}
- 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: Check Server Version to Determine License Version
uses: madhead/semver-utils@latest
id: version
with:
version: ${{ matrix.server_version }}
compare-to: 5.3.0
- name: Set up HZ_LICENSEKEY env
if: ${{ matrix.server_kind == 'ENTERPRISE' }}
run: |
echo "HZ_LICENSEKEY=${{ '>' == steps.version.outputs.comparison-result && secrets.HAZELCAST_ENTERPRISE_KEY || secrets.HAZELCAST_ENTERPRISE_KEY_V5 }}" >> $GITHUB_ENV
- name: Build modules
shell: bash -l {0}
run: |
chmod +x mvnw
JAVA_HOME=${{env.JAVA_HOME}} ./mvnw -B -V -e clean install -DskipTests -Dtest.hazelcast-server.version=${{ matrix.server_version }}
working-directory: client
- name: Run remote controller for non-enterprise tests
if: ${{ matrix.tests_type == 'OS' }}
working-directory: client/hazelcast-java-client/target/test-artifacts
run: |
${{env.SERVER_JAVA}}/bin/java -cp additional-libs/*:hazelcast-remote-controller.jar:hazelcast.jar:test-artifacts.jar:../test-classes/jars/testsubjects.jar:../test-classes/jars/test.jar: -Djava.security.krb5.conf=../../src/test/resources/krb5.conf -Dhazelcast.phone.home.enabled=false -Dhazelcast.logging.details.enabled=true --add-opens=java.base/java.lang=ALL-UNNAMED com.hazelcast.remotecontroller.Main --use-simple-server > server_log.txt &
- name: Run remote controller for enterprise tests
if: ${{ matrix.tests_type == 'ENTERPRISE' }}
working-directory: client/hazelcast-enterprise-java-client/target/test-artifacts
run: |
${{env.SERVER_JAVA}}/bin/java -cp additional-libs/*:hazelcast-remote-controller.jar:../test-artifacts:hazelcast-enterprise.jar:hazelcast.jar:test-artifacts.jar:os-test-artifacts.jar:test-vector-artifacts.jar:test-os-vector-artifacts.jar:../test-classes/jars/testsubjects.jar:../test-classes/jars/test.jar: -Djava.security.krb5.conf=../../src/test/resources/krb5.conf -Dhazelcast.logging.details.enabled=true -Dhazelcast.hidensity.check.freememory=false --add-exports java.base/jdk.internal.ref=ALL-UNNAMED --add-opens jdk.management/com.sun.management.internal=ALL-UNNAMED --add-opens java.management/sun.management=ALL-UNNAMED --add-exports jdk.management/com.ibm.lang.management.internal=ALL-UNNAMED --add-opens java.base/java.nio=ALL-UNNAMED --add-opens java.base/sun.nio.ch=ALL-UNNAMED --add-opens java.base/java.lang=ALL-UNNAMED --add-opens java.base/java.lang.reflect=ALL-UNNAMED --add-opens java.base/java.util.concurrent=ALL-UNNAMED --add-opens java.base/java.util=ALL-UNNAMED com.hazelcast.remotecontroller.Main --use-simple-server 2> server_log.txt &
- name: Run non-enterprise tests
if: ${{ matrix.tests_type == 'OS' }}
shell: bash -l {0}
run: |
chmod +x mvnw
JAVA_HOME=${{env.JAVA_HOME}} ./mvnw -B -V -e test -Pintegration-tests -Dtest.hazelcast-server.version=${{ matrix.server_version }} -Dtest="${{ matrix.test_filter }}" -Dsurefire.failIfNoSpecifiedTests=false
working-directory: client/hazelcast-java-client
- name: Run enterprise tests
if: ${{ matrix.tests_type == 'ENTERPRISE' }}
shell: bash -l {0}
run: |
chmod +x mvnw
JAVA_HOME=${{env.JAVA_HOME}} ./mvnw -B -V -e test -Pintegration-tests -Dtest.hazelcast-server.version=${{ matrix.server_version }} -Dtest="${{ matrix.test_filter }}" -Dsurefire.failIfNoSpecifiedTests=false
working-directory: client/hazelcast-enterprise-java-client
- name: Extract package name
if: always()
run: |
PACKAGE_NAME=$(echo '${{ matrix.test_filter }}' | awk -F',' '{print $1}' | \
sed -E 's/^com\.hazelcast\.//' | \
sed -E 's/\.\*\*$//' | \
sed -E 's/\.\*Test$/-Test/' | \
sed -E 's/\./-/g')
echo "PACKAGE_NAME=$PACKAGE_NAME" >> $GITHUB_ENV
- name: Truncate log name
uses: 2428392/gh-truncate-string-action@v1
if: always()
id: trancate_package
with:
stringToTruncate: ${{ env.PACKAGE_NAME }}
maxLength: 200
- name: Archive server logs
uses: actions/upload-artifact@v4
if: always()
with:
name: server-${{ matrix.server_version }}-${{ matrix.server_kind }}-logs-tests-${{ steps.trancate_package.outputs.string }}
path: |
client/hazelcast-java-client/target/test-artifacts/server_log.txt
client/hazelcast-enterprise-java-client/target/test-artifacts/server_log.txt