]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Generate, check the JUnit reports for the doctest job
authorŠtěpán Balážik <stepan@isc.org>
Tue, 6 Jan 2026 15:42:34 +0000 (16:42 +0100)
committerŠtěpán Balážik <stepan@isc.org>
Wed, 7 Jan 2026 17:43:16 +0000 (18:43 +0100)
Pass it to GitLab for display.

(cherry picked from commit 0f2d0daabc47eaa5fbde2ceb0b30c35df9f9e255)

.gitlab-ci.yml

index df0a33efd00a6dc27dba56d67f0cecaf3061f4e7..3671649270d129f655b13c56cbd16c393fc46f7c 100644 (file)
@@ -781,16 +781,32 @@ coccinelle:
 
 doctest:
   <<: *precheck_job
+  # This script needs to: 1) fail if the doctest fails, 2) fail if
+  # the junit.xml file is broken, 3) produce the junit.xml file even if
+  # the doctest fails.  Therefore, $RET is used to "cache" the
+  # result of running pytest as interrupting the script immediately when
+  # a doctest fails would make checking the contents of the junit.xml
+  # file impossible (GitLab Runner uses "set -o pipefail").
   script:
     - *configure
+    - *find_python
     - *find_pytest
     - export TOP_BUILDDIR=$(cat bin/tests/system/isctest/vars/.ac_vars/TOP_BUILDDIR)
     - cd bin/tests/system/isctest
+    - RET=0
     - >
-      "$PYTEST" --noconftest --doctest-modules
+      "$PYTEST" --noconftest --doctest-modules --junit-xml="$CI_PROJECT_DIR/junit_doctest.xml" || RET=1
+    - *git_clone_bind9-qa
+    - >
+      "$PYTHON" bind9-qa/ci/postprocess_junit_files.py "$CI_PROJECT_DIR/junit_doctest.xml" --output "$CI_PROJECT_DIR/junit.xml"
+    - (exit $RET)
   needs:
     - job: autoreconf
       artifacts: true
+  artifacts:
+    reports:
+      junit:
+        - junit.xml
 
 pylint:
   <<: *precheck_job