-
Notifications
You must be signed in to change notification settings - Fork 271
390 lines (330 loc) · 13.5 KB
/
integration-tests.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
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
name: Integration Tests Workflow
on:
push:
paths-ignore:
- '.gitignore'
- 'LICENSE'
- 'README*'
- 'docs/**'
- '.github/workflows/**'
branches: [ main ]
pull_request:
paths-ignore:
- '.gitignore'
- 'LICENSE'
- 'README*'
- 'docs/**'
branches: [ main ]
concurrency:
# Only run once for latest commit per ref and cancel other (previous) runs.
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
prepare-integration-tests:
name: Prepare for Integration Tests
runs-on: ubuntu-22.04
if: github.repository_owner == 'Apicurio' && !contains(github.event.*.labels.*.name, 'DO NOT MERGE')
steps:
- name: Show Actor
run: echo ${{github.actor}}
- name: Checkout Code
uses: actions/checkout@v3
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
cache: 'maven'
# Open-Source Machine emulator that allows you to emulate multiple CPU architectures on your machine
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
# Docker CLI plugin for extended build capabilities with BuildKit
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v1
- name: Inspect builder
run: |
echo "Name: ${{ steps.buildx.outputs.name }}"
echo "Endpoint: ${{ steps.buildx.outputs.endpoint }}"
echo "Status: ${{ steps.buildx.outputs.status }}"
echo "Flags: ${{ steps.buildx.outputs.flags }}"
echo "Platforms: ${{ steps.buildx.outputs.platforms }}"
- name: Get maven wrapper
run: mvn -N io.takari:maven:wrapper -Dmaven=3.8.2
- name: Build Application
run: ./mvnw clean package -am --no-transfer-progress -Pprod -DskipTests=true -Dmaven.javadoc.skip=true -Dmaven.wagon.httpconnectionManager.maxTotal=30 -Dmaven.wagon.http.retryHandler.count=5
- name: Build and Push Application image
run: |
docker buildx build --push -f ./distro/docker/target/docker/Dockerfile.jvm -t ttl.sh/${{ github.sha }}/apicurio/apicurio-registry:1d --platform linux/amd64,linux/arm64,linux/s390x,linux/ppc64le ./distro/docker/target/docker
prepare-ui-tests:
name: Prepare for UI Integration Tests
runs-on: ubuntu-22.04
if: github.repository_owner == 'Apicurio' && !contains(github.event.*.labels.*.name, 'DO NOT MERGE')
steps:
- name: Show Actor
run: echo ${{github.actor}}
- name: Checkout Code
uses: actions/checkout@v3
- name: Set up Node
uses: actions/setup-node@v3
with:
node-version: 18
cache: 'npm'
cache-dependency-path: 'ui/**/package-lock.json'
- name: Install UI Dependencies
working-directory: ui
run: npm install
- name: Lint UI Code
working-directory: ui
run: npm run lint
- name: Build the UI
working-directory: ui
run: npm run build
- name: Package the UI
working-directory: ui
run: npm run package
- name: Build and Push UI container image
working-directory: ui
env:
IMAGE_REPO: ttl.sh/${{ github.sha }}
# maximum allowed
IMAGE_TAG: 1d
run: |
docker build -t $IMAGE_REPO/apicurio/apicurio-registry-ui:$IMAGE_TAG .
docker push $IMAGE_REPO/apicurio/apicurio-registry-ui:$IMAGE_TAG
integration-tests-h2:
name: Integration Tests H2
runs-on: ubuntu-22.04
needs: prepare-integration-tests
steps:
- name: Checkout Code
uses: actions/checkout@v3
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
cache: 'maven'
- name: Setup Minikube
uses: manusa/[email protected]
with:
minikube version: 'v1.31.1'
kubernetes version: 'v1.26.3'
github token: ${{ secrets.GITHUB_TOKEN }}
driver: docker
- name: Prepare minikube tunnel
run: minikube tunnel &> /dev/null &
- name: Run Integration Tests - H2
run: ./mvnw verify -am --no-transfer-progress -Pintegration-tests -Pci -Dregistry-in-memory-image=ttl.sh/${{ github.sha }}/apicurio/apicurio-registry:1d -Premote-mem -pl integration-tests -Dmaven.javadoc.skip=true
- name: Run Integration Tests - auth - H2
run: ./mvnw verify -am --no-transfer-progress -Pintegration-tests -Pauth -Dregistry-in-memory-image=ttl.sh/${{ github.sha }}/apicurio/apicurio-registry:1d -Premote-mem -pl integration-tests -Dmaven.javadoc.skip=true
- name: Run Integration Tests - migration - H2
run: ./mvnw verify -am --no-transfer-progress -Pintegration-tests -Pmigration -Dregistry-in-memory-image=ttl.sh/${{ github.sha }}/apicurio/apicurio-registry:1d -Premote-mem -pl integration-tests -Dmaven.javadoc.skip=true
- name: Collect logs
if: failure()
run: sh ./.github/scripts/collect_logs.sh
- name: Upload tests logs artifacts
if: failure()
uses: actions/[email protected]
with:
name: tests-logs-h2
path: artifacts
integration-tests-postgresql:
name: Integration Tests Postgresql
runs-on: ubuntu-22.04
needs: prepare-integration-tests
steps:
- name: Checkout Code
uses: actions/checkout@v3
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
cache: 'maven'
- name: Setup Minikube
uses: manusa/[email protected]
with:
minikube version: 'v1.31.1'
kubernetes version: 'v1.26.3'
github token: ${{ secrets.GITHUB_TOKEN }}
driver: docker
- name: Prepare minikube tunnel
run: minikube tunnel &> /dev/null &
- name: Run Integration Tests - Postgresql
run: ./mvnw verify -am --no-transfer-progress -Pintegration-tests -Pci -Dregistry-sql-image=ttl.sh/${{ github.sha }}/apicurio/apicurio-registry:1d -Premote-sql -pl integration-tests -Dmaven.javadoc.skip=true
- name: Run Integration Tests - auth - Postgresql
run: ./mvnw verify -am --no-transfer-progress -Pintegration-tests -Pauth -Dregistry-sql-image=ttl.sh/${{ github.sha }}/apicurio/apicurio-registry:1d -Premote-sql -pl integration-tests -Dmaven.javadoc.skip=true
- name: Run Integration Tests - migration - Postgresql
run: ./mvnw verify -am --no-transfer-progress -Pintegration-tests -Pmigration -Dregistry-sql-image=ttl.sh/${{ github.sha }}/apicurio/apicurio-registry:1d -Premote-sql -pl integration-tests -Dmaven.javadoc.skip=true
- name: Collect logs
if: failure()
run: sh ./.github/scripts/collect_logs.sh
- name: Upload tests logs artifacts
if: failure()
uses: actions/[email protected]
with:
name: tests-logs-postgresql
path: artifacts
integration-tests-kafkasql:
name: Integration Tests KafkaSql
runs-on: ubuntu-22.04
needs: prepare-integration-tests
steps:
- name: Checkout Code
uses: actions/checkout@v3
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
cache: 'maven'
- name: Setup Minikube
uses: manusa/[email protected]
with:
minikube version: 'v1.31.1'
kubernetes version: 'v1.26.3'
github token: ${{ secrets.GITHUB_TOKEN }}
driver: docker
- name: Prepare minikube tunnel
run: minikube tunnel &> /dev/null &
- name: Run Integration Tests - Kafkasql
run: ./mvnw verify -am --no-transfer-progress -Pintegration-tests -Pci -Dregistry-kafkasql-image=ttl.sh/${{ github.sha }}/apicurio/apicurio-registry:1d -Premote-kafka -pl integration-tests -Dmaven.javadoc.skip=true
- name: Run Integration Tests - auth - Kafkasql
run: ./mvnw verify -am --no-transfer-progress -Pintegration-tests -Pauth -Dregistry-kafkasql-image=ttl.sh/${{ github.sha }}/apicurio/apicurio-registry:1d -Premote-kafka -pl integration-tests -Dmaven.javadoc.skip=true
- name: Run Integration Tests - migration - Kafkasql
run: ./mvnw verify -am --no-transfer-progress -Pintegration-tests -Pmigration -Dregistry-kafkasql-image=ttl.sh/${{ github.sha }}/apicurio/apicurio-registry:1d -Premote-kafka -pl integration-tests -Dmaven.javadoc.skip=true
- name: Run Integration Tests - snapshotting - Kafkasql
run: ./mvnw verify -am --no-transfer-progress -Pintegration-tests -Pkafkasql-snapshotting -Dregistry-kafkasql-image=ttl.sh/${{ github.sha }}/apicurio/apicurio-registry:1d -Premote-kafka -pl integration-tests -Dmaven.javadoc.skip=true
- name: Collect logs
if: failure()
run: sh ./.github/scripts/collect_logs.sh
- name: Upload tests logs artifacts
if: failure()
uses: actions/[email protected]
with:
name: tests-logs-kafkasql
path: artifacts
integration-tests-ui:
name: Integration Tests UI
runs-on: ubuntu-22.04
needs: [prepare-ui-tests, prepare-integration-tests]
steps:
- name: Checkout Code
uses: actions/checkout@v3
- name: Set up Node
uses: actions/setup-node@v3
with:
node-version: 18
cache: 'npm'
cache-dependency-path: 'ui/tests/package-lock.json'
- name: Run UI tests
run: |
echo "Starting Registry App (In Memory)"
docker run -it -p 8080:8080 -e apicurio.rest.deletion.artifact.enabled=true -d ttl.sh/${{ github.sha }}/apicurio/apicurio-registry:1d
echo "Starting Registry UI"
docker run -it -p 8888:8080 -d ttl.sh/${{ github.sha }}/apicurio/apicurio-registry-ui:1d
cd ui/tests
npm install
npx playwright install --with-deps
echo "App System Info:"
echo "--"
curl -s http://localhost:8080/apis/registry/v3/system/info
echo "--"
echo ""
echo "UI Config Info (Local):"
echo "--"
curl -s http://localhost:8888/config.js
echo "--"
echo ""
echo "UI Config Info (Remote):"
echo "--"
curl -s http://localhost:8080/apis/registry/v3/system/uiConfig
echo "--"
echo ""
echo "UI Version Info:"
curl -s http://localhost:8888/version.js
echo "--"
echo "UI index.html:"
echo "--"
curl -s http://localhost:8888
echo "--"
echo ""
echo "-------------------------"
echo "Running Playwright tests!"
echo "-------------------------"
npm run test
- name: Upload Test Report
uses: actions/upload-artifact@v3
if: always()
with:
name: playwright-report
path: ui/tests/playwright-report/
retention-days: 30
integration-tests-legacy-v2:
name: Integration Tests Legacy V2
runs-on: ubuntu-22.04
needs: prepare-integration-tests
steps:
- name: Checkout Registry 2.5
uses: actions/checkout@v4
with:
ref: '2.5.x'
path: registry-v2
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
cache: 'maven'
- name: Run Legacy Integration Tests (Core API v2)
run: |
echo "Starting Registry App (In Memory)"
docker run -it -p 8181:8080 -e apicurio.rest.deletion.artifact.enabled=true -d ttl.sh/${{ github.sha }}/apicurio/apicurio-registry:1d
cd registry-v2
./mvnw -Pintegration-tests clean install -DskipTests=true -DskipUiBuild=true -Dmaven.javadoc.skip=true
cd integration-tests
../mvnw verify -Pregression -Dmaven.javadoc.skip=true -Dquarkus.http.test-host=localhost -Dquarkus.http.test-port=8181
- name: Collect logs
if: failure()
run: sh ./.github/scripts/collect_logs.sh
- name: Upload tests logs artifacts
if: failure()
uses: actions/[email protected]
with:
name: tests-logs-legacy-v2
path: artifacts
integration-tests-typescript-sdk:
name: Integration Tests Typescript SDK
runs-on: ubuntu-22.04
needs: prepare-integration-tests
steps:
- name: Checkout Code
uses: actions/checkout@v3
- name: Run SDK tests
run: |
echo "Starting Registry App (In Memory)"
docker run -it -p 8080:8080 -e apicurio.rest.deletion.artifact.enabled=true -d ttl.sh/${{ github.sha }}/apicurio/apicurio-registry:1d
cd typescript-sdk
npm install
npm run generate-sources
npm run test
build-examples:
name: Build and Run Application examples
runs-on: ubuntu-22.04
needs: prepare-integration-tests
steps:
- name: Checkout Code with Ref '${{ github.ref }}'
uses: actions/checkout@v2
with:
path: apicurio-registry
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
cache: 'maven'
- name: Run Apicurio Registry application
run: docker run -d -p 8080:8080 -it ttl.sh/${{ github.sha }}/apicurio/apicurio-registry:1d
- name: Build Apicurio Registry with Examples
run: cd apicurio-registry && mvn clean install -DskipTests -Pexamples