From 3fedff22d84124657a6474f4d11ef43a37bea62e Mon Sep 17 00:00:00 2001
From: Martin Hierholzer <martin.hierholzer@desy.de>
Date: Mon, 5 Nov 2018 11:35:48 +0100
Subject: [PATCH] do not fail if coverage report could not be produced. This
 happens frequently due to bugs (?) in lcov on Ubuntu 1604

---
 vars/helper.groovy | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/vars/helper.groovy b/vars/helper.groovy
index 6ba3cd7..f14c71a 100644
--- a/vars/helper.groovy
+++ b/vars/helper.groovy
@@ -206,10 +206,10 @@ def doCoverage(String label, String buildType) {
   sh """
     cd /scratch/build-${parentJob}
     sudo -u msk_jenkins make coverage || true
-    sudo -u msk_jenkins /common/lcov_cobertura-1.6/lcov_cobertura/lcov_cobertura.py coverage.info
+    sudo -u msk_jenkins /common/lcov_cobertura-1.6/lcov_cobertura/lcov_cobertura.py coverage.info || true
     
-    sudo -u msk_jenkins cp -r coverage_html ${WORKSPACE}
-    sudo -u msk_jenkins cp -r coverage.xml ${WORKSPACE}
+    sudo -u msk_jenkins cp -r coverage_html ${WORKSPACE} || true
+    sudo -u msk_jenkins cp -r coverage.xml ${WORKSPACE} || true
   """
   
   // stash cobertura coverage report result for later publication
@@ -217,7 +217,7 @@ def doCoverage(String label, String buildType) {
   
   // publish HTML coverage report now, since it already allows publication of multiple distinguised reports
   publishHTML (target: [
-      allowMissing: false,
+      allowMissing: true,
       alwaysLinkToLastBuild: false,
       keepAll: false,
       reportDir: "coverage_html",
-- 
GitLab