From b05aedf422e5d291bcd94ad156ae9c1058a06b3f Mon Sep 17 00:00:00 2001 From: Matt Rendina Date: Thu, 29 Nov 2018 13:41:04 -0500 Subject: Ignore status codes from all commands in test_cmds. (#24) --- vars/utils.groovy | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'vars/utils.groovy') diff --git a/vars/utils.groovy b/vars/utils.groovy index d6ee25c..c37ea21 100644 --- a/vars/utils.groovy +++ b/vars/utils.groovy @@ -367,7 +367,13 @@ def run(configs, concurrent = true) { try { stage("Test (${myconfig.name})") { for (cmd in myconfig.test_cmds) { - sh(script: cmd) + // Ignore status code from all commands in + // test_cmds so Jenkins will always make it + // to the post-build stage. + // This accommodates tools like pytest returning + // !0 codes when a test fails which would + // abort the job too early. + sh(script: "${cmd} || true") } } } -- cgit