Hi,
given the following simple pipeline script (just a POC):
stage('Testing') {
def testSuites = env.TESTSUITES.split(',')
def testJobs = [:]
testSuites.each { suite ->
testJobs[suite] = {
build job: 'Executor', parameters: [string(name: 'TESTSUITE', value: suite)]
}
}
parallel testJobs
}
How can I programmatically
What I currently get is that the pipeline job reports failure or success for all downstream jobs, but in the summary it just lists the first failed one. Since this should execute tests, I'd need to know which exact test has failed. It then also sets the overall status to failed, but I'd like to set it to unstable if at least one, but not all tests have failed.
How can I achieve this?
Thanks...
Dirk
Dirk Heinrichs
Senior Systems Engineer, Delivery Pipeline
OpenText ™ Discovery | Recommind
Email: dhei...@opentext.com
Website: www.recommind.de
Recommind GmbH, Von-Liebig-Straße 1, 53359 Rheinbach
Vertretungsberechtigte Geschäftsführer John Marshall Doolittle, Gordon Davies, Roger Illing, Registergericht Amtsgericht Bonn, Registernummer HRB 10646
This e-mail may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error) please notify the sender immediately and destroy this e-mail. Any unauthorized copying, disclosure or distribution of the material in this e-mail is strictly forbidden
Diese E-Mail enthält vertrauliche und/oder rechtlich geschützte Informationen. Wenn Sie nicht der richtige Adressat sind oder diese E-Mail irrtümlich erhalten haben, informieren Sie bitte sofort den Absender und vernichten Sie diese Mail. Das unerlaubte Kopieren sowie die unbefugte Weitergabe dieser Mail sind nicht gestattet.
import hudson.model.Result
stage('Testing') {
def testSuites = ['a', 'b', 'c']
def testJobs = [:] def status = [:] testSuites.each { suite -> testJobs[suite] = { status[suite] = build job: 'Executor1', parameters: [string(name: 'TESTSUITE', value: suite)], propagate: false } }
parallel testJobs // set build status if (status.find { it.getValue().getResult().equals('UNSTABLE') }) { currentBuild.result = 'UNSTABLE' } else if (status.find { it.getValue().getResult().equals('FAILURE') }) { currentBuild.result = 'FAILURE' }}