]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Enable unit test artifacts for gcov jobs
authorNicki Křížek <nicki@isc.org>
Tue, 28 Jan 2025 15:59:47 +0000 (16:59 +0100)
committerNicki Křížek <nicki@isc.org>
Wed, 29 Jan 2025 14:17:07 +0000 (15:17 +0100)
Without using the build artifacts from the unit test jobs in the
bookworm tests, the gcov would be incomplete.

(cherry picked from commit e5636598a5fd795ef80421f3a5d48c511a9498ff)

.gitlab-ci.yml

index 43b3ebecbdc7b4668d8963c8518e01da68456e68..de90980832d45958b20f4a05aba1673f9fb07061 100644 (file)
@@ -53,6 +53,9 @@ variables:
 
   HYPOTHESIS_PROFILE: "ci"
 
+  # Some jobs may clean up the build artifacts unless this is set to 0.
+  CLEAN_BUILD_ARTIFACTS_ON_SUCCESS: 1
+
 default:
   # Allow all running CI jobs to be automatically canceled when a new
   # version of a branch is pushed.
@@ -364,7 +367,7 @@ stages:
     - >
       "$PYTEST" --junit-xml="$CI_PROJECT_DIR"/junit.xml -n "$TEST_PARALLEL_JOBS" | tee pytest.out.txt
     - '( ! grep -F "grep: warning:" pytest.out.txt )'
-    - make clean >/dev/null 2>&1
+    - test "$CLEAN_BUILD_ARTIFACTS_ON_SUCCESS" -eq 0 || ( cd ../../.. && make clean >/dev/null 2>&1 )
   after_script:
     - test -n "${OUT_OF_TREE_WORKSPACE}" && cd "${OUT_OF_TREE_WORKSPACE}"
     - *display_pytest_failures
@@ -434,7 +437,7 @@ stages:
     - test -n "${OUT_OF_TREE_WORKSPACE}" && cd "${OUT_OF_TREE_WORKSPACE}"
   script:
     - make -j${TEST_PARALLEL_JOBS:-1} -k unit V=1
-    - make clean >/dev/null 2>&1
+    - test "$CLEAN_BUILD_ARTIFACTS_ON_SUCCESS" -eq 0 || make clean >/dev/null 2>&1
   after_script:
     - test -d bind-* && cd bind-*
     - REALSOURCEDIR="$PWD"
@@ -888,7 +891,8 @@ system:gcc:bookworm:amd64:
   <<: *system_test_gcov_job
   variables:
     CI_ENABLE_ALL_TESTS: 1
-  needs:
+    CLEAN_BUILD_ARTIFACTS_ON_SUCCESS: 0
+  needs:  # using artifacts from unit test job is required for gcov
     - job: unit:gcc:bookworm:amd64
       artifacts: true
 
@@ -897,6 +901,7 @@ unit:gcc:bookworm:amd64:
   <<: *unit_test_gcov_job
   variables:
     CI_ENABLE_ALL_TESTS: 1
+    CLEAN_BUILD_ARTIFACTS_ON_SUCCESS: 0
   needs:
     - job: gcc:bookworm:amd64
       artifacts: true