diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 522677fcfb..df826b291d 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -207,14 +207,16 @@ stages: stage: build before_script: - test -w "${CCACHE_DIR}" && export PATH="/usr/lib/ccache:${PATH}" - - test -n "${OOT_BUILD_WORKSPACE}" && mkdir "${OOT_BUILD_WORKSPACE}" && cd "${OOT_BUILD_WORKSPACE}" + - test -n "${OUT_OF_TREE_WORKSPACE}" && mkdir "${OUT_OF_TREE_WORKSPACE}" && cd "${OUT_OF_TREE_WORKSPACE}" script: - *configure - *check_readline_setup - make -j${BUILD_PARALLEL_JOBS:-1} -k all V=1 - test -z "${RUN_MAKE_INSTALL}" || make install - test -z "${RUN_MAKE_INSTALL}" || sh util/check-make-install - - if test "$(git status --porcelain | grep -Ev '\?\?' | wc -l)" -gt "0"; then git status --short; exit 1; fi + - if test -z "${OUT_OF_TREE_WORKSPACE}" && test "$(git status --porcelain | grep -Ev '\?\?' | wc -l)" -gt "0"; then git status --short; exit 1; fi + after_script: + - test -n "${OUT_OF_TREE_WORKSPACE}" && mv "${OUT_OF_TREE_WORKSPACE}" "${CI_PROJECT_DIR}" needs: - job: autoreconf artifacts: true @@ -266,14 +268,20 @@ stages: <<: *default_triggering_rules stage: system before_script: - - *setup_interfaces - *setup_softhsm + # Move the artifacts from the out-of-tree build job to their original location (the out-of-tree workspace). + - test -n "${OUT_OF_TREE_WORKSPACE}" && mv "$(basename "${OUT_OF_TREE_WORKSPACE}")" "${OUT_OF_TREE_WORKSPACE}" + # Continue work in the out-of-tree workspace. + - test -n "${OUT_OF_TREE_WORKSPACE}" && cd "${OUT_OF_TREE_WORKSPACE}" + - *setup_interfaces script: - cd bin/tests/system - make -j${TEST_PARALLEL_JOBS:-1} -k check V=1 after_script: + - test -n "${OUT_OF_TREE_WORKSPACE}" && cd "${OUT_OF_TREE_WORKSPACE}" - test -d bind-* && cd bind-* - cat bin/tests/system/test-suite.log + - test -n "${OUT_OF_TREE_WORKSPACE}" && mv "${OUT_OF_TREE_WORKSPACE}" "${CI_PROJECT_DIR}" .system_test: &system_test_job <<: *system_test_common @@ -495,7 +503,6 @@ docs: stage: docs before_script: - test -w "${CCACHE_DIR}" && export PATH="/usr/lib/ccache:${PATH}" - - test -n "${OOT_BUILD_WORKSPACE}" && mkdir "${OOT_BUILD_WORKSPACE}" && cd "${OOT_BUILD_WORKSPACE}" script: - *configure - make -j${BUILD_PARALLEL_JOBS:-1} -k doc V=1 @@ -709,13 +716,26 @@ gcc:out-of-tree: variables: CC: gcc CFLAGS: "${CFLAGS_COMMON} -Og" - CONFIGURE: ../configure + CONFIGURE: "${CI_PROJECT_DIR}/configure" EXTRA_CONFIGURE: "--enable-dnstap --with-libidn2 --with-lmdb" RUN_MAKE_INSTALL: 1 - OOT_BUILD_WORKSPACE: workspace + OUT_OF_TREE_WORKSPACE: /tmp/out_of_tree_workspace <<: *base_image <<: *build_job +system:gcc:out-of-tree: + variables: + OUT_OF_TREE_WORKSPACE: /tmp/out_of_tree_workspace + needs: + - job: gcc:out-of-tree + artifacts: true + <<: *base_image + <<: *system_test_job + only: + - schedules + - tags + - web + # Jobs for tarball GCC builds on Debian 10 "buster" (amd64) gcc:tarball: diff --git a/bin/tests/system/run.sh.in b/bin/tests/system/run.sh.in index ed6c2e2a9a..2ab8bb91e7 100644 --- a/bin/tests/system/run.sh.in +++ b/bin/tests/system/run.sh.in @@ -294,21 +294,36 @@ elif [ "$sanitizer_summaries" -ne 0 ]; then echoinfo "I:$systest:$sanitizer_summaries sanitizer report(s) found" fi +print_outstanding_files() { + if test -d ${srcdir}/../../../.git; then + git status -su --ignored "${systest}" 2>/dev/null | \ + sed -n -e 's|^?? \(.*\)|I:file \1 not removed|p' \ + -e 's|^!! \(.*/named.run\)$|I:file \1 not removed|p' \ + -e 's|^!! \(.*/named.memstats\)$|I:file \1 not removed|p' + fi +} + +print_outstanding_files_oot() { + if test -d ${srcdir}/../../../.git; then + git -C "${srcdir}/${systest}" ls-files | sed "s|^|${systest}/|" > gitfiles.txt + find "${systest}/" -type f ! -name .prepared ! -name Makefile > testfiles.txt + grep -F -x -v -f gitfiles.txt testfiles.txt + rm -f gitfiles.txt testfiles.txt + fi +} + if [ $status -ne 0 ]; then echofail "R:$systest:FAIL" else echopass "R:$systest:PASS" if $clean; then - ( cd "${systest}" && $SHELL clean.sh "$@" ) - if [ "${srcdir}" != "${builddir}" ]; then - rm -rf "./${systest}" ## FIXME (this also removes compiled binaries) - fi - if test -d ${srcdir}/../../../.git; then - git status -su --ignored "${systest}" 2>/dev/null | \ - sed -n -e 's|^?? \(.*\)|I:file \1 not removed|p' \ - -e 's|^!! \(.*/named.run\)$|I:file \1 not removed|p' \ - -e 's|^!! \(.*/named.memstats\)$|I:file \1 not removed|p' - fi + ( cd "${systest}" && $SHELL clean.sh "$@" ) + if [ "${srcdir}" = "${builddir}" ]; then + print_outstanding_files + else + print_outstanding_files_oot | xargs rm -f + find "${systest}/" \( -type d -empty \) -delete 2>/dev/null + fi fi fi