From c56aa9fc7e0697aad91eb7c5c2892e21363f7d17 Mon Sep 17 00:00:00 2001 From: Matt Rendina Date: Tue, 28 Nov 2017 11:38:25 -0500 Subject: Add test report ingestion --- vars/utils.groovy | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) (limited to 'vars') diff --git a/vars/utils.groovy b/vars/utils.groovy index 24a050a..5d06399 100644 --- a/vars/utils.groovy +++ b/vars/utils.groovy @@ -49,9 +49,21 @@ def concurrent(configs) { unstash "source_tree" sh(script: "ls -al") } //end stage - stage("Test (${myconfig.build_mode})") { - if (myconfig.run_tests) { - println("RUNNING TESTS") + if (myconfig.run_tests) { + try { + stage("Test (${myconfig.build_mode})") { + // Test command(s) here + println("RUNNING TESTS") + } + } + finally { + // TODO: Test for presence of report file. + step([$class: 'XUnitBuilder', + thresholds: [ + [$class: 'SkippedThreshold', failureThreshold: '0'], + [$class: 'FailedThreshold', unstableThreshold: '1'], + [$class: 'FailedThreshold', failureThreshold: '6']], + tools: [[$class: 'JUnitType', pattern: '*.xml']]]) } } } //end withEnv -- cgit