Hi,

Build step returns a RunWrapper object therefore you could save their 
status in another hash/array and then query whether any of those downstream 
builds are unstable if so then set the currentBuild as UNSTABLE, for 
instance based on your snippet:



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'
  }
}


Further details:
- 
http://javadoc.jenkins.io/plugin/workflow-support/org/jenkinsci/plugins/workflow/support/steps/build/RunWrapper.html
- http://javadoc.jenkins-ci.org/hudson/model/Result.html

My two cents

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/e8312e3b-e9f1-4218-8dcd-7a06acb724a6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to