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

Commit 4bc2b3b

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 d1ef51f commit 4bc2b3b

File tree

1 file changed

+25
-1
lines changed

1 file changed

+25
-1
lines changed

.gitlab-ci.yml

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,6 +253,10 @@ stages:
253253
- PYTHON="$(source bin/tests/system/conf.sh; echo $PYTHON)"
254254
- test -x "$PYTHON"
255255

256+
.find_pytest: &find_pytest
257+
- PYTEST="$(source bin/tests/system/conf.sh; echo $PYTEST)"
258+
- test -x "$PYTEST"
259+
256260
.parse_tsan: &parse_tsan
257261
- find -name 'tsan.*' -exec "$PYTHON" util/parse_tsan.py {} \;
258262

@@ -317,6 +321,17 @@ stages:
317321
before_script:
318322
- test -n "${OUT_OF_TREE_WORKSPACE}" && cd "${OUT_OF_TREE_WORKSPACE}"
319323
- *setup_interfaces
324+
script:
325+
- *find_pytest
326+
- cd bin/tests/system
327+
- >
328+
"$PYTEST" --junit-xml="$CI_PROJECT_DIR"/junit.xml -n "$TEST_PARALLEL_JOBS" --dist loadscope | tee pytest.out.txt
329+
- '( ! grep -F "grep: warning:" pytest.out.txt )'
330+
after_script:
331+
- awk '/^=+ FAILURES =+/{flag=1;next}/^=+.*=+$/{flag=0}flag' bin/tests/system/pytest.out.txt || true
332+
- awk '/^=+ ERRORS =+/{flag=1;next}/^=+.*=+$/{flag=0}flag' bin/tests/system/pytest.out.txt || true
333+
334+
.system_test_legacy: &system_test_legacy
320335
script:
321336
- cd bin/tests/system
322337
- make -j${TEST_PARALLEL_JOBS:-1} -k check V=1
@@ -336,6 +351,8 @@ stages:
336351
<<: *system_test_common
337352
artifacts:
338353
untracked: true
354+
exclude:
355+
- "**/__pycache__/**/*"
339356
when: always
340357
reports:
341358
junit: junit.xml
@@ -344,19 +361,24 @@ stages:
344361
<<: *system_test_common
345362
artifacts:
346363
untracked: true
364+
exclude:
365+
- "**/__pycache__/**/*"
347366
when: always
348367

349368
.system_test_tsan: &system_test_tsan_job
350369
<<: *system_test_common
351370
after_script:
352-
- cat bin/tests/system/test-suite.log
371+
- awk '/^=+ FAILURES =+/{flag=1;next}/^=+.*=+$/{flag=0}flag' bin/tests/system/pytest.out.txt || true
372+
- awk '/^=+ ERRORS =+/{flag=1;next}/^=+.*=+$/{flag=0}flag' bin/tests/system/pytest.out.txt || true
353373
- find bin/tests/system -name "*dig.*" | xargs grep "error" || true
354374
- *find_python
355375
- *parse_tsan
356376
- >
357377
"$PYTHON" bin/tests/convert-trs-to-junit.py . > "$CI_PROJECT_DIR"/junit.xml
358378
artifacts:
359379
untracked: true
380+
exclude:
381+
- "**/__pycache__/**/*"
360382
when: always
361383
reports:
362384
junit: junit.xml
@@ -859,6 +881,7 @@ system:gcc:out-of-tree:
859881
artifacts: true
860882
<<: *base_image
861883
<<: *system_test_job
884+
<<: *system_test_legacy
862885
<<: *api_schedules_tags_triggers_web_triggering_rules
863886

864887
unit:gcc:out-of-tree:
@@ -1193,6 +1216,7 @@ clang:openbsd:amd64:
11931216
system:clang:openbsd:amd64:
11941217
<<: *openbsd_amd64_image
11951218
<<: *system_test_job
1219+
<<: *system_test_legacy
11961220
<<: *api_schedules_triggers_web_triggering_rules
11971221
variables:
11981222
USER: gitlab-runner

0 commit comments

Comments
 (0)