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 `<testsuites><testsuite /></testsuites>`)
- - 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
- 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 )
- *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
- 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:
- *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.
- 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