Skip to content

Commit 61923c7

Browse files
committed
added reusable systme tests
1 parent f9ff451 commit 61923c7

File tree

1 file changed

+317
-0
lines changed

1 file changed

+317
-0
lines changed
Lines changed: 317 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,317 @@
1+
name: Reusable System Tests
2+
3+
on:
4+
workflow_call:
5+
inputs:
6+
python-version:
7+
required: true
8+
type: string
9+
description: "Python version to use"
10+
os:
11+
required: true
12+
type: string
13+
description: "Runner OS to use"
14+
uv-version:
15+
required: false
16+
type: string
17+
default: "0.1.25"
18+
description: "UV version to use"
19+
run-public-api:
20+
required: false
21+
type: boolean
22+
default: true
23+
description: "Whether to run public API tests"
24+
run-swarm-deploy:
25+
required: false
26+
type: boolean
27+
default: true
28+
description: "Whether to run swarm deploy tests"
29+
run-e2e:
30+
required: false
31+
type: boolean
32+
default: true
33+
description: "Whether to run E2E tests"
34+
run-e2e-playwright:
35+
required: false
36+
type: boolean
37+
default: true
38+
description: "Whether to run E2E Playwright tests"
39+
run-environment-setup:
40+
required: false
41+
type: boolean
42+
default: true
43+
description: "Whether to run environment setup tests"
44+
45+
jobs:
46+
system-test-public-api:
47+
if: ${{ inputs.run-public-api }}
48+
timeout-minutes: 25 # if this timeout gets too small, then split the tests
49+
name: "[sys] public api"
50+
runs-on: ${{ inputs.os }}
51+
steps:
52+
- uses: actions/checkout@v4
53+
- name: setup docker buildx
54+
id: buildx
55+
uses: docker/setup-buildx-action@v3
56+
with:
57+
driver: docker-container
58+
- name: setup python environment
59+
uses: actions/setup-python@v5
60+
with:
61+
python-version: ${{ inputs.python-version }}
62+
- name: expose github runtime for buildx
63+
uses: crazy-max/ghaction-github-runtime@v3
64+
# FIXME: Workaround for https://github.com/actions/download-artifact/issues/249
65+
- name: download docker images with retry
66+
uses: Wandalen/wretry.action@master
67+
with:
68+
action: actions/download-artifact@v4
69+
with: |
70+
pattern: docker-buildx-images-${{ runner.os }}-${{ github.sha }}-*
71+
path: /${{ runner.temp }}/build
72+
attempt_limit: 5
73+
attempt_delay: 1000
74+
75+
- name: install uv
76+
uses: astral-sh/setup-uv@v6
77+
with:
78+
version: ${{ inputs.uv-version }}
79+
enable-cache: false
80+
cache-dependency-glob: "**/public-api/requirements/ci.txt"
81+
- name: load docker images
82+
run: make load-images local-src=/${{ runner.temp }}/build
83+
- name: show system version
84+
run: ./ci/helpers/show_system_versions.bash
85+
- name: install
86+
env:
87+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
88+
run: ./ci/github/system-testing/public-api.bash install
89+
- name: test
90+
run: ./ci/github/system-testing/public-api.bash test
91+
- name: upload failed tests logs
92+
if: ${{ failure() }}
93+
uses: actions/upload-artifact@v4
94+
with:
95+
name: ${{ github.job }}_docker_logs
96+
path: ./test_failures
97+
- name: cleanup
98+
if: ${{ !cancelled() }}
99+
run: ./ci/github/system-testing/public-api.bash clean_up
100+
101+
system-test-swarm-deploy:
102+
if: ${{ inputs.run-swarm-deploy }}
103+
timeout-minutes: 30 # if this timeout gets too small, then split the tests
104+
name: "[sys] deploy simcore"
105+
runs-on: ${{ inputs.os }}
106+
steps:
107+
- uses: actions/checkout@v4
108+
- name: setup docker buildx
109+
id: buildx
110+
uses: docker/setup-buildx-action@v3
111+
with:
112+
driver: docker-container
113+
- name: setup python environment
114+
uses: actions/setup-python@v5
115+
with:
116+
python-version: ${{ inputs.python-version }}
117+
- name: expose github runtime for buildx
118+
uses: crazy-max/ghaction-github-runtime@v3
119+
# FIXME: Workaround for https://github.com/actions/download-artifact/issues/249
120+
- name: download docker images with retry
121+
uses: Wandalen/wretry.action@master
122+
with:
123+
action: actions/download-artifact@v4
124+
with: |
125+
pattern: docker-buildx-images-${{ runner.os }}-${{ github.sha }}-*
126+
path: /${{ runner.temp }}/build
127+
attempt_limit: 5
128+
attempt_delay: 1000
129+
- name: install uv
130+
uses: astral-sh/setup-uv@v6
131+
with:
132+
version: "0.6.x"
133+
enable-cache: false
134+
cache-dependency-glob: "**/swarm-deploy/requirements/ci.txt"
135+
- name: load docker images
136+
run: make load-images local-src=/${{ runner.temp }}/build
137+
- name: show system version
138+
run: ./ci/helpers/show_system_versions.bash
139+
- name: install
140+
run: ./ci/github/system-testing/swarm-deploy.bash install
141+
- name: test
142+
run: ./ci/github/system-testing/swarm-deploy.bash test
143+
- name: dump services setting schemas
144+
run: export DOCKER_REGISTRY=local; export DOCKER_IMAGE_TAG=production; make settings-schema.json
145+
- name: upload services settings schemas
146+
uses: actions/upload-artifact@v4
147+
with:
148+
name: ${{ github.job }}_services_settings_schemas
149+
path: ./services/**/settings-schema.json
150+
- name: upload failed tests logs
151+
if: ${{ failure() }}
152+
uses: actions/upload-artifact@v4
153+
with:
154+
name: ${{ github.job }}_docker_logs
155+
path: ./test_failures
156+
- name: cleanup
157+
if: ${{ !cancelled() }}
158+
run: ./ci/github/system-testing/swarm-deploy.bash clean_up
159+
160+
system-test-e2e:
161+
if: ${{ inputs.run-e2e }}
162+
timeout-minutes: 30 # if this timeout gets too small, then split the tests
163+
name: "[sys] e2e"
164+
runs-on: ${{ inputs.os }}
165+
steps:
166+
- uses: actions/checkout@v4
167+
- name: setup docker buildx
168+
id: buildx
169+
uses: docker/setup-buildx-action@v3
170+
with:
171+
driver: docker-container
172+
- name: setup python environment
173+
uses: actions/setup-python@v5
174+
with:
175+
python-version: ${{ inputs.python-version }}
176+
- uses: actions/[email protected]
177+
with:
178+
node-version: ${{ inputs.node-version }}
179+
cache: "npm"
180+
cache-dependency-path: "tests/e2e/package-lock.json"
181+
- name: expose github runtime for buildx
182+
uses: crazy-max/ghaction-github-runtime@v3
183+
# FIXME: Workaround for https://github.com/actions/download-artifact/issues/249
184+
- name: download docker images with retry
185+
uses: Wandalen/wretry.action@master
186+
with:
187+
action: actions/download-artifact@v4
188+
with: |
189+
pattern: docker-buildx-images-${{ runner.os }}-${{ github.sha }}-*
190+
path: /${{ runner.temp }}/build
191+
attempt_limit: 5
192+
attempt_delay: 1000
193+
- name: install uv
194+
uses: astral-sh/setup-uv@v6
195+
with:
196+
version: ${{ inputs.uv-version }}
197+
enable-cache: false
198+
cache-dependency-glob: "**/e2e/requirements/requirements.txt"
199+
- name: load docker images
200+
run: make load-images local-src=/${{ runner.temp }}/build
201+
- name: show system version
202+
run: ./ci/helpers/show_system_versions.bash
203+
- name: setup
204+
run: ./ci/github/system-testing/e2e.bash install
205+
- name: test
206+
run: ./ci/github/system-testing/e2e.bash test
207+
- name: dump docker logs
208+
if: ${{ !cancelled() }}
209+
run: ./ci/github/system-testing/e2e.bash dump_docker_logs
210+
- name: upload docker logs
211+
if: ${{ !cancelled() }}
212+
uses: actions/upload-artifact@v4
213+
with:
214+
name: ${{ github.job }}_docker_logs
215+
path: ./tests/e2e/test_failures
216+
- name: upload screenshots
217+
if: ${{ !cancelled() }}
218+
uses: actions/upload-artifact@v4
219+
with:
220+
name: ${{ github.job }}_screenshots
221+
path: tests/e2e/screenshots
222+
- name: upload e2e logs
223+
if: ${{ !cancelled() }}
224+
uses: actions/upload-artifact@v4
225+
with:
226+
name: ${{ github.job }}_logs
227+
path: tests/e2e/logs
228+
- name: cleanup
229+
if: ${{ !cancelled() }}
230+
run: ./ci/github/system-testing/e2e.bash clean_up
231+
232+
system-test-e2e-playwright:
233+
if: ${{ inputs.run-e2e-playwright }}
234+
timeout-minutes: 30 # if this timeout gets too small, then split the tests
235+
name: "[sys] e2e-playwright"
236+
runs-on: ${{ inputs.os }}
237+
steps:
238+
- uses: actions/checkout@v4
239+
- name: setup docker buildx
240+
id: buildx
241+
uses: docker/setup-buildx-action@v3
242+
with:
243+
driver: docker-container
244+
- name: setup python environment
245+
uses: actions/setup-python@v5
246+
with:
247+
python-version: ${{ inputs.python-version }}
248+
- name: install uv
249+
uses: astral-sh/setup-uv@v6
250+
with:
251+
version: ${{ inputs.uv-version }}
252+
enable-cache: false
253+
cache-dependency-glob: "**/e2e-playwright/requirements/ci.txt"
254+
- name: expose github runtime for buildx
255+
uses: crazy-max/ghaction-github-runtime@v3
256+
- name: download docker images
257+
uses: actions/download-artifact@v4
258+
with:
259+
pattern: docker-buildx-images-${{ runner.os }}-${{ github.sha }}-*
260+
path: /${{ runner.temp }}/build
261+
- name: load docker images
262+
run: make load-images local-src=/${{ runner.temp }}/build
263+
- name: prepare devenv
264+
run: make devenv
265+
- name: show system version
266+
run: ./ci/helpers/show_system_versions.bash
267+
- name: setup
268+
run: ./ci/github/system-testing/e2e-playwright.bash install
269+
- name: test
270+
run: ./ci/github/system-testing/e2e-playwright.bash test
271+
- name: dump docker logs
272+
if: ${{ !cancelled() }}
273+
run: ./ci/github/system-testing/e2e-playwright.bash dump_docker_logs
274+
- name: upload docker logs
275+
if: ${{ !cancelled() }}
276+
uses: actions/upload-artifact@v4
277+
with:
278+
name: ${{ github.job }}_docker_logs
279+
path: ./tests/e2e-playwright/test_failures
280+
- name: upload tracing if failed
281+
if: ${{ !cancelled() }}
282+
uses: actions/upload-artifact@v4
283+
with:
284+
name: ${{ github.job }}_tracing
285+
path: tests/e2e-playwright/test-results
286+
287+
system-test-environment-setup:
288+
if: ${{ inputs.run-environment-setup }}
289+
timeout-minutes: 30 # if this timeout gets too small, then split the tests
290+
name: "[sys] environment setup"
291+
runs-on: ${{ inputs.os }}
292+
steps:
293+
- uses: actions/checkout@v4
294+
- name: setup docker buildx
295+
id: buildx
296+
uses: docker/setup-buildx-action@v3
297+
with:
298+
driver: docker-container
299+
- name: setup python environment
300+
uses: actions/setup-python@v5
301+
with:
302+
python-version: ${{ inputs.python-version }}
303+
- name: install uv
304+
uses: astral-sh/setup-uv@v6
305+
with:
306+
version: ${{ inputs.uv-version }}
307+
enable-cache: false
308+
cache-dependency-glob: "**/environment-setup/requirements/ci.txt"
309+
- name: show system version
310+
run: ./ci/helpers/show_system_versions.bash
311+
- name: install
312+
run: ./ci/github/system-testing/environment-setup.bash install
313+
- name: test
314+
run: ./ci/github/system-testing/environment-setup.bash test
315+
- name: cleanup
316+
if: ${{ !cancelled() }}
317+
run: ./ci/github/system-testing/environment-setup.bash clean_up

0 commit comments

Comments
 (0)