diff options
author | Matt Rendina <rendinam@users.noreply.github.com> | 2019-02-11 16:42:32 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-02-11 16:42:32 -0500 |
commit | 79e549361392144948b44e22d3798c237b06b1af (patch) | |
tree | 447443307c9007f1f7569c983f899cb8a6f47c5f | |
parent | 0c9cc2ff4bf07a4d09d783e3a871136c55d789fd (diff) | |
download | jscu_refactor-79e549361392144948b44e22d3798c237b06b1af.tar.gz |
Only process test report if it exists. (#32)
-rw-r--r-- | vars/utils.groovy | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/vars/utils.groovy b/vars/utils.groovy index 43a5d07..aafa001 100644 --- a/vars/utils.groovy +++ b/vars/utils.groovy @@ -254,24 +254,25 @@ def testSummaryNotify(single_issue) { def processTestReport(config, index) { def config_name = config.name report_exists = sh(script: "test -e *.xml", returnStatus: true) - def thresh_summary = "failedUnstableThresh: ${config.failedUnstableThresh}\n" + + def threshold_summary = "failedUnstableThresh: ${config.failedUnstableThresh}\n" + "failedFailureThresh: ${config.failedFailureThresh}\n" + "skippedUnstableThresh: ${config.skippedUnstableThresh}\n" + "skippedFailureThresh: ${config.skippedFailureThresh}" - println(thresh_summary) + println(threshold_summary) // Process the XML results file to include the build config name as a prefix // on each test name to make it more obvious from where each result originates. - sh(script:"sed -i 's/ name=\"/ name=\"[${config.name}] /g' *.xml") - if (report_exists == 0) { + repfile = sh(script:"find *.xml", returnStdout: true) + sh(script:"cp ${repfile} ${repfile}.modified") + sh(script:"sed -i 's/ name=\"/ name=\"[${config.name}] /g' *.xml.modified") step([$class: 'XUnitBuilder', thresholds: [ [$class: 'SkippedThreshold', unstableThreshold: "${config.skippedUnstableThresh}"], [$class: 'SkippedThreshold', failureThreshold: "${config.skippedFailureThresh}"], [$class: 'FailedThreshold', unstableThreshold: "${config.failedUnstableThresh}"], [$class: 'FailedThreshold', failureThreshold: "${config.failedFailureThresh}"]], - tools: [[$class: 'JUnitType', pattern: '*.xml']]]) + tools: [[$class: 'JUnitType', pattern: '*.xml.modified']]]) } else { println("No .xml files found in workspace. Test report ingestion skipped.") @@ -414,7 +415,8 @@ def buildAndTest(config, index) { processTestReport(config, index) } // end test test_cmd finally clause - } // end stage test_cmd + } // end if(config.test_cmds...) + } // end withEnv } |