From e0aed1db4d2dcce8de1c3eddf867202a419ab1ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=A0t=C4=9Bp=C3=A1n=20Bal=C3=A1=C5=BEik?= Date: Thu, 11 Dec 2025 22:28:04 +0100 Subject: [PATCH 1/3] Factor the cloning of the QA repo into an anchor The unusual hyphen in the anchor name is used for symmetry with the bind9-qa repo and directory name. (cherry picked from commit c3f5db6dbc224e3c58f307fb1fdc327242241594) --- .gitlab-ci.yml | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 4db2daaeba..6e52cc5965 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -385,6 +385,9 @@ stages: $EXTRA_CONFIGURE || (test -s config.log && cat config.log; exit 1) +.git-clone-bind9-qa: &git_clone_bind9-qa + - git clone --depth 1 https://gitlab.isc.org/isc-projects/bind9-qa.git + # change directory to the workspace before including this .find_python: &find_python - PYTHON="$(cat bin/tests/system/isctest/vars/.ac_vars/PYTHON)" @@ -662,7 +665,7 @@ stages: - *configure - make -j${BUILD_PARALLEL_JOBS:-1} V=1 - *setup_interfaces - - git clone --depth 1 https://gitlab.isc.org/isc-projects/bind9-qa.git + - *git_clone_bind9-qa - cd bind9-qa/respdiff needs: [] artifacts: @@ -737,7 +740,7 @@ ci-variables: ci-orphaned-anchors: <<: *precheck_job script: - - git clone --depth 1 https://gitlab.isc.org/isc-projects/bind9-qa.git + - *git_clone_bind9-qa - bind9-qa/ci-orphaned-anchors/check-orphaned-anchors-ci.py .gitlab-ci.yml needs: [] rules: @@ -1951,7 +1954,7 @@ publish: <<: *manual_release_job <<: *base_image before_script: - - git clone --depth 1 https://gitlab.isc.org/isc-projects/bind9-qa.git + - *git_clone_bind9-qa needs: - job: staging artifacts: false @@ -2069,7 +2072,7 @@ customer-git:branch: BRANCH: '$CI_COMMIT_BRANCH' before_script: - test -n "$CUSTOMER" - - git clone --depth 1 https://gitlab.isc.org/isc-projects/bind9-qa.git + - *git_clone_bind9-qa script: - git checkout -b "$BRANCH" # ensure refs/heads/$BRANCH exists; GitLab clones with detached HEAD - bind9-qa/releng/push_to_customer_repository.py --branch "$BRANCH" --customer "$CUSTOMER" --force @@ -2082,7 +2085,7 @@ customer-git:tag: rules: - *rule_tag before_script: - - git clone --depth 1 https://gitlab.isc.org/isc-projects/bind9-qa.git + - *git_clone_bind9-qa - git clone --depth 1 "https://token:${ISC_CUSTOMERS_WRITE_TOKEN}@gitlab.isc.org/isc-customers/isc-customer-settings.git" script: - bind9-qa/releng/push_to_customer_repository.py --tag "$CI_COMMIT_TAG" --entitlements isc-customer-settings/entitlements.yaml --force @@ -2257,7 +2260,7 @@ generate-stress-test-configs: <<: *default_triggering_rules stage: precheck script: - - git clone --depth 1 https://gitlab.isc.org/isc-projects/bind9-qa.git + - *git_clone_bind9-qa - bind9-qa/stress/generate-stress-test-configs.py > stress-test-configs.yml artifacts: paths: @@ -2375,7 +2378,7 @@ pairwise: - > : stop if this is not a merge request in the current project\'s namespace - test -n "$MERGE_REQUEST_ID" || exit 0 - - git clone --depth 1 https://gitlab.isc.org/isc-projects/bind9-qa.git + - *git_clone_bind9-qa backports: <<: *post_merge From ccc2008d1f4e024da906cfe4c6d1cd8dc532ac98 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=A0t=C4=9Bp=C3=A1n=20Bal=C3=A1=C5=BEik?= Date: Wed, 15 Oct 2025 18:33:18 +0200 Subject: [PATCH 2/3] Check the validity of cross-version-config-test's XML output This was overlooked before. (cherry picked from commit 5528ed7a5b1d3f3246ea43e35f4dfabe68ed7d5a) --- .gitlab-ci.yml | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 6e52cc5965..ac3e755183 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -976,8 +976,17 @@ cross-version-config-tests: # release using the binaries built for the current BIND 9 version. This # intends to detect obvious backward compatibility issues with the latter. - sed -i "s|f\"{AC_VARS\['TOP_BUILDDIR'\]}|\"$CI_PROJECT_DIR|g" isctest/vars/basic.py + # This script needs to: 1) fail if the tests fail, 2) fail if + # the junit.xml file is broken, 3) produce the junit.xml file even if + # the tests fail. Therefore, $RET is used to "cache" the + # result of running pytest as interrupting the script immediately when + # system tests fail would make checking the contents of the junit.xml + # file impossible (GitLab Runner uses "set -o pipefail"). + - RET=0 - > - "$PYTEST" --setup-only --junit-xml="$CI_PROJECT_DIR"/junit.xml -n "${TEST_PARALLEL_JOBS:-1}" + "$PYTEST" --setup-only --junit-xml="$CI_PROJECT_DIR"/junit.xml -n "${TEST_PARALLEL_JOBS:-1}" || RET=1 + - *check_for_junit_xml + - (exit $RET) needs: - job: autoreconf artifacts: true From e2d389b60a94f0b37884278df18a50a6d4967d96 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=A0t=C4=9Bp=C3=A1n=20Bal=C3=A1=C5=BEik?= Date: Wed, 15 Oct 2025 18:26:48 +0200 Subject: [PATCH 3/3] Replace check_for_junit_xml anchor with a Python script This allows checking of multiple files with variable filenames rather than insisting on harcoded `junit.xml`. (cherry picked from commit abecddb13afa3f8ad9611f1241a635fbe6b90818) --- .gitlab-ci.yml | 34 ++++++++++++++-------------------- 1 file changed, 14 insertions(+), 20 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index ac3e755183..0d7ad2da1f 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -440,21 +440,6 @@ stages: fi fi -.check_for_junit_xml: &check_for_junit_xml - # test if junit.xml file exists and is longer 40 bytes - # (i.e., contains more than ``) - - if [ -f "$CI_PROJECT_DIR"/junit.xml ]; then - if [ $(wc -c < "$CI_PROJECT_DIR"/junit.xml) -gt 40 ]; then - echo "junit.xml file exists and is longer than 40 bytes."; - else - echo "junit.xml file exists but is too short."; - exit 1; - fi - else - echo "junit.xml file does not exist."; - exit 1; - fi - .build: &build_job <<: *default_triggering_rules stage: build @@ -570,7 +555,9 @@ stages: - if pytest --version | grep -F "pytest 9.0" >/dev/null; then echo "filterwarnings = ignore::pytest.PytestRemovedIn9Warning" >> pytest.ini; fi - > ("$PYTEST" --junit-xml="$CI_PROJECT_DIR"/junit.xml -n "$TEST_PARALLEL_JOBS" | tee pytest.out.txt) || RET=1 - - *check_for_junit_xml + - git clone --depth 1 https://gitlab.isc.org/isc-projects/bind9-qa.git + - > + "$PYTHON" bind9-qa/ci/postprocess_junit_files.py "$CI_PROJECT_DIR"/junit.xml --output "$CI_PROJECT_DIR"/junit.xml - (exit $RET) - '( ! grep -F "grep: warning:" pytest.out.txt )' - test "$CLEAN_BUILD_ARTIFACTS_ON_SUCCESS" -eq 0 || ( cd ../../.. && make clean >/dev/null 2>&1 ) @@ -605,7 +592,9 @@ stages: - *find_python - > "$PYTHON" bin/tests/convert-trs-to-junit.py . > "$CI_PROJECT_DIR"/junit.xml - - *check_for_junit_xml + - *git_clone_bind9-qa + - > + "$PYTHON" bind9-qa/ci/postprocess_junit_files.py "$CI_PROJECT_DIR"/junit.xml --output "$CI_PROJECT_DIR"/junit.xml - (exit $RET) after_script: - cat bin/tests/system/test-suite.log || true @@ -632,9 +621,11 @@ stages: - RET=0 - make -j${TEST_PARALLEL_JOBS:-1} -k unit V=1 || RET=$? - *find_python + - *git_clone_bind9-qa - > "$PYTHON" "$CI_PROJECT_DIR"/bin/tests/convert-trs-to-junit.py . > "$CI_PROJECT_DIR"/junit.xml - - *check_for_junit_xml + - > + "$PYTHON" bind9-qa/ci/postprocess_junit_files.py "$CI_PROJECT_DIR"/junit.xml --output "$CI_PROJECT_DIR"/junit.xml - (exit $RET) - test "$CLEAN_BUILD_ARTIFACTS_ON_SUCCESS" -eq 0 || make clean >/dev/null 2>&1 artifacts: @@ -957,12 +948,13 @@ cross-version-config-tests: - *configure - *setup_interfaces - make -j${BUILD_PARALLEL_JOBS:-1} + - *find_python + - *find_pytest - git clone --branch "${BIND_BASELINE_VERSION}" --depth 1 https://gitlab.isc.org/isc-projects/bind9.git "bind-${BIND_BASELINE_VERSION}" - cd "bind-${BIND_BASELINE_VERSION}" - autoreconf -fi - *configure - make -j${BUILD_PARALLEL_JOBS:-1} - - *find_pytest # The cross-version-config-tests job would fail when a system test is # removed from the upcoming release. To avoid this, remove the system test # also from the $BIND_BASELINE_VERSION. @@ -985,7 +977,9 @@ cross-version-config-tests: - RET=0 - > "$PYTEST" --setup-only --junit-xml="$CI_PROJECT_DIR"/junit.xml -n "${TEST_PARALLEL_JOBS:-1}" || RET=1 - - *check_for_junit_xml + - *git_clone_bind9-qa + - > + "$PYTHON" bind9-qa/ci/postprocess_junit_files.py "$CI_PROJECT_DIR"/junit.xml --output "$CI_PROJECT_DIR"/junit.xml - (exit $RET) needs: - job: autoreconf