Skip to content
This repository was archived by the owner on Aug 13, 2025. It is now read-only.

Commit 46d45c9

Browse files
committed
Use pytest system test runner in CI
Replace the legacy system test runner by the pytest system test runner. Since EL7 and OpenBSD have only ancient versions of pytest / xdist, keep using the legacy test runner there for now. Out of tree tests aren't supported by the pytest runner yet. Use the legacy test runner for that purpose as well. Use awk to display failures and errors at the end of the log for convenience, since pytest displays them first, which makes them difficult to find.
1 parent 4e63a0f commit 46d45c9

File tree

1 file changed

+26
-5
lines changed

1 file changed

+26
-5
lines changed

.gitlab-ci.yml

Lines changed: 26 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -242,6 +242,10 @@ stages:
242242
- PYTHON="$(source bin/tests/system/conf.sh; echo $PYTHON)"
243243
- test -x "$PYTHON"
244244

245+
.find_pytest: &find_pytest
246+
- PYTEST="$(source bin/tests/system/conf.sh; echo $PYTEST)"
247+
- test -x "$PYTEST"
248+
245249
.parse_tsan: &parse_tsan
246250
- find -name 'tsan.*' -exec "$PYTHON" util/parse_tsan.py {} \;
247251

@@ -307,6 +311,17 @@ stages:
307311
before_script:
308312
- test -n "${OUT_OF_TREE_WORKSPACE}" && cd "${OUT_OF_TREE_WORKSPACE}"
309313
- *setup_interfaces
314+
script:
315+
- *find_pytest
316+
- cd bin/tests/system
317+
- >
318+
"$PYTEST" --junit-xml="$CI_PROJECT_DIR"/junit.xml -n "$TEST_PARALLEL_JOBS" --dist loadscope | tee pytest.out.txt
319+
- '( ! grep -F "grep: warning:" pytest.out.txt )'
320+
after_script:
321+
- awk '/^=+ FAILURES =+/{flag=1;next}/^=+.*=+$/{flag=0}flag' bin/tests/system/pytest.out.txt
322+
- awk '/^=+ ERRORS =+/{flag=1;next}/^=+.*=+$/{flag=0}flag' bin/tests/system/pytest.out.txt
323+
324+
.system_test_legacy: &system_test_legacy
310325
script:
311326
- cd bin/tests/system
312327
- make -j${TEST_PARALLEL_JOBS:-1} -k check V=1
@@ -325,6 +340,8 @@ stages:
325340
<<: *system_test_common
326341
artifacts:
327342
untracked: true
343+
exclude:
344+
- "**/__pycache__/**/*"
328345
expire_in: "1 day"
329346
when: always
330347
reports:
@@ -334,19 +351,20 @@ stages:
334351
<<: *system_test_common
335352
artifacts:
336353
untracked: true
354+
exclude:
355+
- "**/__pycache__/**/*"
337356
expire_in: "1 day"
338357
when: always
339358

340359
.system_test_tsan: &system_test_tsan_job
341360
<<: *system_test_common
342361
after_script:
343-
- cat bin/tests/system/test-suite.log
344-
- *find_python
345-
- *parse_tsan
346-
- >
347-
"$PYTHON" bin/tests/convert-trs-to-junit.py . > "$CI_PROJECT_DIR"/junit.xml
362+
- awk '/^=+ FAILURES =+/{flag=1;next}/^=+.*=+$/{flag=0}flag' bin/tests/system/pytest.out.txt
363+
- awk '/^=+ ERRORS =+/{flag=1;next}/^=+.*=+$/{flag=0}flag' bin/tests/system/pytest.out.txt
348364
artifacts:
349365
untracked: true
366+
exclude:
367+
- "**/__pycache__/**/*"
350368
expire_in: "1 day"
351369
when: always
352370
reports:
@@ -604,6 +622,7 @@ gcc:oraclelinux7:amd64:
604622
system:gcc:oraclelinux7:amd64:
605623
<<: *oraclelinux_7_amd64_image
606624
<<: *system_test_job
625+
<<: *system_test_legacy
607626
needs:
608627
- job: gcc:oraclelinux7:amd64
609628
artifacts: true
@@ -820,6 +839,7 @@ system:gcc:out-of-tree:
820839
artifacts: true
821840
<<: *base_image
822841
<<: *system_test_job
842+
<<: *system_test_legacy
823843
<<: *api_schedules_tags_triggers_web_triggering_rules
824844

825845
unit:gcc:out-of-tree:
@@ -1148,6 +1168,7 @@ clang:openbsd:amd64:
11481168
system:clang:openbsd:amd64:
11491169
<<: *openbsd_amd64_image
11501170
<<: *system_test_job
1171+
<<: *system_test_legacy
11511172
<<: *api_schedules_triggers_web_triggering_rules
11521173
variables:
11531174
USER: gitlab-runner

0 commit comments

Comments
 (0)