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

Commit 79efe9b

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 2e6cb77 commit 79efe9b

File tree

1 file changed

+20
-5
lines changed

1 file changed

+20
-5
lines changed

.gitlab-ci.yml

Lines changed: 20 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
@@ -340,11 +355,8 @@ stages:
340355
.system_test_tsan: &system_test_tsan_job
341356
<<: *system_test_common
342357
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
358+
- awk '/^=+ FAILURES =+/{flag=1;next}/^=+.*=+$/{flag=0}flag' bin/tests/system/pytest.out.txt
359+
- awk '/^=+ ERRORS =+/{flag=1;next}/^=+.*=+$/{flag=0}flag' bin/tests/system/pytest.out.txt
348360
artifacts:
349361
untracked: true
350362
expire_in: "1 day"
@@ -604,6 +616,7 @@ gcc:oraclelinux7:amd64:
604616
system:gcc:oraclelinux7:amd64:
605617
<<: *oraclelinux_7_amd64_image
606618
<<: *system_test_job
619+
<<: *system_test_legacy
607620
needs:
608621
- job: gcc:oraclelinux7:amd64
609622
artifacts: true
@@ -820,6 +833,7 @@ system:gcc:out-of-tree:
820833
artifacts: true
821834
<<: *base_image
822835
<<: *system_test_job
836+
<<: *system_test_legacy
823837
<<: *api_schedules_tags_triggers_web_triggering_rules
824838

825839
unit:gcc:out-of-tree:
@@ -1148,6 +1162,7 @@ clang:openbsd:amd64:
11481162
system:clang:openbsd:amd64:
11491163
<<: *openbsd_amd64_image
11501164
<<: *system_test_job
1165+
<<: *system_test_legacy
11511166
<<: *api_schedules_triggers_web_triggering_rules
11521167
variables:
11531168
USER: gitlab-runner

0 commit comments

Comments
 (0)