From: Štěpán Balážik Date: Wed, 15 Oct 2025 16:26:48 +0000 (+0200) Subject: Replace check_for_junit_xml anchor with a Python script X-Git-Tag: v9.21.17~18^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=abecddb13afa3f8ad9611f1241a635fbe6b90818;p=thirdparty%2Fbind9.git 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`. --- diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 86873802707..eb21ca579e3 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -432,21 +432,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 @@ -558,7 +543,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 ../../.. && ninja -C build clean >/dev/null 2>&1 ) @@ -593,7 +580,10 @@ stages: - meson test -C build --no-rebuild --no-suite flaky || RET=1 - cp build/meson-logs/testlog.junit.xml $CI_PROJECT_DIR/junit.xml - meson test -C build --no-rebuild --suite flaky --logbase testlog-flaky || meson test -C build --no-rebuild --suite flaky --logbase testlog-flaky || RET=1 - - *check_for_junit_xml + - git clone --depth 1 https://gitlab.isc.org/isc-projects/bind9-qa.git + - *find_python + - > + "$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 || ninja -C build clean >/dev/null 2>&1 artifacts: @@ -923,6 +913,7 @@ cross-version-config-tests: - *setup_interfaces - meson compile -C build system-test-init system-test-dependencies - meson compile -C build + - *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}" @@ -948,7 +939,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: ci-variables