From bcefb0db1e9822b87163a5daf6277b5f9b42ebeb Mon Sep 17 00:00:00 2001 From: beierl Date: Thu, 25 Jul 2019 15:44:34 -0400 Subject: [PATCH] Adds conditional steps for reports If coverage or junit files exist, publish them via Jenkins plugins. Junit plugin is already present. Coberatura plugin needs to be installed before this can be merged. Bug 803 Change-Id: I898e32a6b9dd28c958e7fea2422c416f3c2c077e Signed-off-by: beierl --- jenkins/ci-pipelines/ci_stage_2.groovy | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/jenkins/ci-pipelines/ci_stage_2.groovy b/jenkins/ci-pipelines/ci_stage_2.groovy index d0e9d9dc..ddbd80aa 100644 --- a/jenkins/ci-pipelines/ci_stage_2.groovy +++ b/jenkins/ci-pipelines/ci_stage_2.groovy @@ -1,7 +1,7 @@ /* Copyright 2017 Sandvine * * All Rights Reserved. - * + * * Licensed under the Apache License, Version 2.0 (the "License"); you may * not use this file except in compliance with the License. You may obtain * a copy of the License at @@ -55,6 +55,12 @@ def ci_pipeline(mdg,url_prefix,project,branch,refspec,revision,do_stage_3,artifa withDockerContainer(image: "${container_name}", args: docker_args) { stage('Test') { sh 'devops-stages/stage-test.sh' + if (fileExists('coverage.xml')) { + cobertura coberturaReportFile: 'coverage.xml' + } + if (fileExists('nosetests.xml')) { + junit 'nosetests.xml' + } } stage('Build') { sh(returnStdout:true, script: 'devops-stages/stage-build.sh').trim() -- 2.25.1