From 80ab2c0f220b28e20a6e7c0db0293feb692ac6ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20K=C4=99pie=C5=84?= Date: Fri, 6 Apr 2018 12:09:48 +0200 Subject: [PATCH 1/2] Fail CI pipeline when "make test" does not run any system tests Apart from ensuring "make test" returns 0, also check whether any system test output was generated as a result of running it. This prevents the CI job running system tests from succeeding unless it actually tests something. --- .gitlab-ci.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 08a189ddc3..ab8418eb2a 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -100,7 +100,8 @@ stages: - rm -rf .ccache - bash -x bin/tests/system/ifconfig.sh up script: - - cd bin/tests && make -j${TEST_PARALLEL_JOBS:-1} -k test V=1 + - ( cd bin/tests && make -j${TEST_PARALLEL_JOBS:-1} -k test V=1 ) + - test -s bin/tests/system/systests.output artifacts: untracked: true expire_in: '1 week' From 93ee6b8a22d1decf67db3a4a9434f51fd384d62c Mon Sep 17 00:00:00 2001 From: Evan Hunt Date: Fri, 6 Apr 2018 12:09:50 +0200 Subject: [PATCH 2/2] Alter distclean rule to prevent recursing into the same directory twice Commit f87e0c03ee removed the "system" directory from the TESTDIRS variable in bin/tests/Makefile.in in an attempt to fix "make distclean" which was broken since commit 0d784de16a. However, this change prevented any system tests from being run when "make test" is invoked. We now put it back into both SUBDIRS and TESTDIRS, but with a modified rule to check for the existence of a Makefile in each subdirectory before trying to run make there. This prevents "make distclean" from trying to run again in a directory where it's already been run. --- bin/tests/Makefile.in | 2 +- make/rules.in | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/bin/tests/Makefile.in b/bin/tests/Makefile.in index 6d0619b21e..cf2e1bf0d4 100644 --- a/bin/tests/Makefile.in +++ b/bin/tests/Makefile.in @@ -33,7 +33,7 @@ ISCCFGDEPLIBS = ../../lib/isccfg/libisccfg.@A@ LIBS = @LIBS@ SUBDIRS = system @PKCS11_TOOLS@ -TESTDIRS = +TESTDIRS = system # Test programs that are built by default: # cfg_test is needed for regenerating doc/misc/options diff --git a/make/rules.in b/make/rules.in index a1886d14f9..26bd0103ef 100644 --- a/make/rules.in +++ b/make/rules.in @@ -81,7 +81,7 @@ install:: all install uninstall clean distclean maintainer-clean doc docclean man manclean:: @for i in ${ALL_SUBDIRS} ${ALL_TESTDIRS}; do \ - if [ "$$i" != "nulldir" -a -d $$i ]; then \ + if [ "$$i" != "nulldir" -a -d $$i -a -f $$i/Makefile ]; then \ echo "making $@ in `pwd`/$$i"; \ (cd $$i; ${MAKE} ${MAKEDEFS} DESTDIR="${DESTDIR}" $@) || exit 1; \ fi; \