From fddf60da090f271b2fd9a5ff24b57c4fce0f7381 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicki=20K=C5=99=C3=AD=C5=BEek?= Date: Tue, 28 Jan 2025 15:23:01 +0100 Subject: [PATCH 1/2] Use make clean to reduce artifacts in successful jobs Reduce the amount of artifacts stored by running make clean at the end of unit and system test run. If any of the previous commands fail, the runner will stop executing the commands in `script` immediately, so the cleanup only happens if none of the previous commands failed. The build artifacts from unit and system tests are re-used anywhere and should be safe to throw away immediately. Same for respdiff. (cherry picked from commit e59bc5b36610168eadde1ce3687f903d2a4630ce) --- .gitlab-ci.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index b360e4853f..43b3ebecbd 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -364,6 +364,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 after_script: - test -n "${OUT_OF_TREE_WORKSPACE}" && cd "${OUT_OF_TREE_WORKSPACE}" - *display_pytest_failures @@ -433,6 +434,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 after_script: - test -d bind-* && cd bind-* - REALSOURCEDIR="$PWD" @@ -1530,6 +1532,7 @@ respdiff: MAX_DISAGREEMENTS_PERCENTAGE: "0.15" script: - bash respdiff.sh -s named -q "${PWD}/100k_mixed.txt" -c 3 -w "${PWD}/rspworkdir" "${CI_PROJECT_DIR}" "/usr/local/respdiff-reference-bind/sbin/named" + - cd ../.. && make clean >/dev/null 2>&1 respdiff:asan: <<: *respdiff_job @@ -1543,6 +1546,7 @@ respdiff:asan: MAX_DISAGREEMENTS_PERCENTAGE: "0.15" script: - bash respdiff.sh -s named -q "${PWD}/100k_mixed.txt" -c 3 -w "${PWD}/rspworkdir" "${CI_PROJECT_DIR}" "/usr/local/respdiff-reference-bind/sbin/named" + - cd ../.. && make clean >/dev/null 2>&1 respdiff:tsan: <<: *respdiff_job @@ -1559,6 +1563,7 @@ respdiff:tsan: TSAN_OPTIONS: "${TSAN_OPTIONS_DEBIAN}" script: - bash respdiff.sh -s named -q "${PWD}/100k_mixed.txt" -c 3 -w "${PWD}/rspworkdir" "${CI_PROJECT_DIR}" "/usr/local/respdiff-reference-bind/sbin/named" + - cd ../.. && make clean >/dev/null 2>&1 after_script: - *find_python - *parse_tsan @@ -1573,6 +1578,7 @@ respdiff-third-party: MAX_DISAGREEMENTS_PERCENTAGE: "0.2" script: - bash respdiff.sh -s third_party -q "${PWD}/100k_mixed.txt" -c 1 -w "${PWD}/rspworkdir" "${CI_PROJECT_DIR}" + - cd ../.. && make clean >/dev/null 2>&1 # Performance tests From 47cc402dbf058b503b6fdce35198e9dbfaaa4a83 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicki=20K=C5=99=C3=AD=C5=BEek?= Date: Tue, 28 Jan 2025 16:59:47 +0100 Subject: [PATCH 2/2] Enable unit test artifacts for gcov jobs 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 | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 43b3ebecbd..de90980832 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -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