From 3f47fb6bf689dd673f2546e3c8b0492b089f40c3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Soko=C5=82owski?= Date: Mon, 5 Sep 2022 09:06:09 +0200 Subject: [PATCH] ci: use pipefail to actually catch test errors MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Because otherwise when piping optput to `tee` the exit code that affects the result of the whole `sh` call is the last command in the pipe. Signed-off-by: Jakub SokoĊ‚owski --- ci/Jenkinsfile.tests | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/ci/Jenkinsfile.tests b/ci/Jenkinsfile.tests index 942f71a9a4..6889645c05 100644 --- a/ci/Jenkinsfile.tests +++ b/ci/Jenkinsfile.tests @@ -54,10 +54,20 @@ pipeline { stage('Checks') { parallel { stage('Lint') { - steps { sh "make lint 2>&1 | tee ${LOG_FILE}" } + steps { + sh """#!/bin/bash + set -eo pipefail + make lint 2>&1 | tee ${LOG_FILE} + """ + } } stage('Tests') { - steps { sh "make test 2>&1 | tee -a ${LOG_FILE}" } + steps { + sh """#!/bin/bash + set -eo pipefail + make test 2>&1 | tee -a ${LOG_FILE} + """ + } } } }