From: Arnout Vandecappelle (Essensium/Mind) Date: Sun, 21 Oct 2018 10:03:02 +0000 (+0100) Subject: Makefile: .gitlab-ci.yml: fail when listing tests fail X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=70994768824bcc0889f7081b147b3de4cc58642e;p=buildroot.git Makefile: .gitlab-ci.yml: fail when listing tests fail To update the .gitlab-ci.yml file, we run run-tests -l to list all the tests and post-process the output in a format suitable for .gitlab-ci.yml. However, in a pipeline, it is the last command that gives the return value. In addition, we have to redirect stderr of run-tests -l because nose2 prints the tests on stderr, not stdout. Thus, when run-tests -l fails, the update of .gitlab-ci.yml silently succeeds but no tests are included in the .gitlab-ci.yml. To fix this, set the pipefail option. This is bash-specific, but our Makefile ascertains that we are running with bash as the shell (if bash is available, but if it is not, dependencies.sh will error out). The error message is still invisible, but at least make will fail. Signed-off-by: Arnout Vandecappelle (Essensium/Mind) Signed-off-by: Peter Korsgaard --- diff --git a/Makefile b/Makefile index 635068f164..d39a94e832 100644 --- a/Makefile +++ b/Makefile @@ -1151,7 +1151,7 @@ check-package: .gitlab-ci.yml: .gitlab-ci.yml.in cp $< $@ (cd configs; LC_ALL=C ls -1 *_defconfig) | sed 's/$$/: *defconfig/' >> $@ - ./support/testing/run-tests -l 2>&1 | sed -r -e '/^test_run \((.*)\).*/!d; s//\1: *runtime_test/' | LC_ALL=C sort >> $@ + set -o pipefail; ./support/testing/run-tests -l 2>&1 | sed -r -e '/^test_run \((.*)\).*/!d; s//\1: *runtime_test/' | LC_ALL=C sort >> $@ include docs/manual/manual.mk -include $(foreach dir,$(BR2_EXTERNAL_DIRS),$(sort $(wildcard $(dir)/docs/*/*.mk)))