]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Hoist the artifact handling to the `&system_test_common` anchor
authorŠtěpán Balážik <stepan@isc.org>
Wed, 4 Jun 2025 13:06:09 +0000 (15:06 +0200)
committerŠtěpán Balážik <stepan@isc.org>
Thu, 26 Jun 2025 13:47:53 +0000 (15:47 +0200)
In the past artifacts of different types of system test jobs were
treated differently but this is no longer the case.

(cherry picked from commit c61ff639b3a5aa7d4513efdc893aadff95a56c60)

.gitlab-ci.yml

index 6476f9f2d50cb774efd0a532da8ce2325c1d171d..3b49f629c4f589dfc8c52a402d05bca665acdcc4 100644 (file)
@@ -436,6 +436,13 @@ stages:
   after_script:
     - test -n "${OUT_OF_TREE_WORKSPACE}" && cd "${OUT_OF_TREE_WORKSPACE}"
     - *display_pytest_failures
+  artifacts:
+    untracked: true
+    exclude:
+      - "**/__pycache__/**/*"
+    when: always
+    reports:
+      junit: junit.xml
 
 .system_test_legacy: &system_test_legacy
   script:
@@ -454,29 +461,30 @@ stages:
 
 .system_test: &system_test_job
   <<: *system_test_common
-  artifacts:
-    untracked: true
-    exclude:
-      - "**/__pycache__/**/*"
-    when: always
-    reports:
-      junit: junit.xml
 
 .system_test_make_check: &system_test_make_check_job
   <<: *system_test_common
+  # This script needs to: 1) fail if the system tests fail, 2) fail if
+  # the junit.xml file is broken, 3) produce the junit.xml file even if
+  # the system tests fail.  Therefore, $RET is used to "cache" the
+  # result of "make check" as interrupting the script immediately when
+  # system tests fail would prevent the junit.xml file from being
+  # produced.
   script:
     - cd bin/tests/system
-    - make -j${TEST_PARALLEL_JOBS:-1} check
+    - RET=0
+    - make -j${TEST_PARALLEL_JOBS:-1} check || RET=$?
+    - cd "$CI_PROJECT_DIR"
+    - *find_python
+    - >
+      "$PYTHON" bin/tests/convert-trs-to-junit.py . > "$CI_PROJECT_DIR"/junit.xml
+    - *check_for_junit_xml
+    - (exit $RET)
   after_script:
     - cat bin/tests/system/test-suite.log || true
 
 .system_test_gcov: &system_test_gcov_job
   <<: *system_test_common
-  artifacts:
-    untracked: true
-    exclude:
-      - "**/__pycache__/**/*"
-    when: always
 
 .system_test_tsan: &system_test_tsan_job
   <<: *system_test_common
@@ -485,15 +493,6 @@ stages:
     - find bin/tests/system -name "*dig.*" | xargs grep "error" || true
     - *find_python
     - *parse_tsan
-    - >
-      "$PYTHON" bin/tests/convert-trs-to-junit.py . > "$CI_PROJECT_DIR"/junit.xml
-  artifacts:
-    untracked: true
-    exclude:
-      - "**/__pycache__/**/*"
-    when: always
-    reports:
-      junit: junit.xml
 
 .unit_test_common: &unit_test_common
   <<: *default_triggering_rules