From c628f2c71b9b789fa992d26f709a2b9e5d9c5a3e Mon Sep 17 00:00:00 2001 From: Michal Nowak Date: Fri, 11 Sep 2020 09:07:04 +0200 Subject: [PATCH 1/2] Make masterXX.data.in reachable by out-of-tree builds Unit test run for out-of-tree builds used to fail to find masterXX.data.in files: /usr/bin/perl -w /builds/mnowak/bind9/lib/dns/tests/mkraw.pl < testdata/master/master12.data.in > testdata/master/master12.data /bin/bash: testdata/master/master12.data.in: No such file or directory make[4]: *** [Makefile:1910: testdata/master/master12.data] Error 1 --- lib/dns/tests/Makefile.am | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/dns/tests/Makefile.am b/lib/dns/tests/Makefile.am index d57d446483..76e9b96b94 100644 --- a/lib/dns/tests/Makefile.am +++ b/lib/dns/tests/Makefile.am @@ -59,15 +59,15 @@ CLEANFILES = $(EXTRA_master_test_DEPENDENCIES) testdata/master/master12.data: testdata/master/master12.data.in mkdir -p testdata/master - $(PERL) -w $(srcdir)/mkraw.pl < testdata/master/master12.data.in > $@ + $(PERL) -w $(srcdir)/mkraw.pl < $(srcdir)/testdata/master/master12.data.in > $@ testdata/master/master13.data: testdata/master/master13.data.in mkdir -p testdata/master - $(PERL) -w $(srcdir)/mkraw.pl < testdata/master/master13.data.in > $@ + $(PERL) -w $(srcdir)/mkraw.pl < $(srcdir)/testdata/master/master13.data.in > $@ testdata/master/master14.data: testdata/master/master14.data.in mkdir -p testdata/master - $(PERL) -w $(srcdir)/mkraw.pl < testdata/master/master14.data.in > $@ + $(PERL) -w $(srcdir)/mkraw.pl < $(srcdir)/testdata/master/master14.data.in > $@ endif From 741fdd4fe16a8addbd2e09437f7ba6ed22cc6330 Mon Sep 17 00:00:00 2001 From: Michal Nowak Date: Wed, 24 Feb 2021 12:15:59 +0100 Subject: [PATCH 2/2] Add unit:gcc:out-of-tree CI job Also extract the workspace save-and-retrieve logic to YAML anchors. --- .gitlab-ci.yml | 37 +++++++++++++++++++++++++++++++------ 1 file changed, 31 insertions(+), 6 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index a6ad5dfd6d..df73be8a2b 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -238,6 +238,18 @@ stages: grep "^#define HAVE_READLINE_READLINE" config.h; \ fi +# Move the out-of-tree workspace to CI project dir to save it for use in +# dependent jobs. +.save_out_of_tree_workspace: &save_out_of_tree_workspace + - test -n "${OUT_OF_TREE_WORKSPACE}" && mv "${OUT_OF_TREE_WORKSPACE}" "${CI_PROJECT_DIR}" + +# Move the artifacts from the out-of-tree build job to their original +# location (the out-of-tree workspace) and then continue work in the +# out-of-tree workspace. +.retrieve_out_of_tree_workspace: &retrieve_out_of_tree_workspace + - test -n "${OUT_OF_TREE_WORKSPACE}" && mv "$(basename "${OUT_OF_TREE_WORKSPACE}")" "${OUT_OF_TREE_WORKSPACE}" + - test -n "${OUT_OF_TREE_WORKSPACE}" && cd "${OUT_OF_TREE_WORKSPACE}" + .build: &build_job <<: *default_triggering_rules stage: build @@ -253,7 +265,7 @@ stages: - if [[ "${CFLAGS}" == *"-fsanitize=address"* ]]; then ( ! grep -F AddressSanitizer config.log ); 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}" + - *save_out_of_tree_workspace needs: - job: autoreconf artifacts: true @@ -304,10 +316,7 @@ stages: stage: system before_script: - *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}" + - *retrieve_out_of_tree_workspace - *setup_interfaces script: - cd bin/tests/system @@ -317,7 +326,7 @@ stages: - 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}" + - *save_out_of_tree_workspace .system_test: &system_test_job <<: *system_test_common @@ -370,8 +379,11 @@ stages: before_script: - if [ -n "$TCP_CONNECTIONTIMEOUT" ]; then sudo sysctl 'net.inet.tcp.keepinittime=1'; fi - *setup_softhsm + - *retrieve_out_of_tree_workspace script: - make -j${TEST_PARALLEL_JOBS:-1} -k unit V=1 + after_script: + - *save_out_of_tree_workspace .unit_test: &unit_test_job <<: *unit_test_common @@ -775,6 +787,19 @@ system:gcc:out-of-tree: - tags - web +unit:gcc:out-of-tree: + variables: + OUT_OF_TREE_WORKSPACE: /tmp/out_of_tree_workspace + needs: + - job: gcc:out-of-tree + artifacts: true + <<: *base_image + <<: *unit_test_job + only: + - schedules + - tags + - web + # Jobs for tarball GCC builds on Debian 10 "buster" (amd64) gcc:tarball: