Collecting build job results using [.result] property returns null

10 views
Skip to first unread message

tre...@gmail.com

unread,
Oct 3, 2018, 5:26:38 PM10/3/18
to Jenkins Users
I would like to collect all triggered jobs results.
My script looks like this:

stage('Integration Tests') {
steps {
script {
def jobs = [:]
def childJob
def childJobName
pipelineIntegrationJobs.each {
i -> jobs["${nirvanaMajor}.${nirvanaMinor}_${i}"] = {
childJob = build (job: "${nirvanaMajor}.${nirvanaMinor}_${i}", 
parameters: [
string(name: 'branch', value: "${svnBranch}"), 
string(name: 'fix', value: "${env.fix}"), 
string(name: 'buildnumber', value: "${env.buildNumber}"), 
string(name: 'revision', value: "${env.buildNumber}"),
string(name: 'joblabel', value: "${pipelineName}")
], 
quietPeriod: 0, propagate: false, wait: true).result
}
childJobName = "${nirvanaMajor}.${nirvanaMinor}_${i}"
results.put(childJobName, childJob)
}
parallel jobs
}
}
}

In the post section of the pipeline I have this:

script {
println "------------------------------------"
println "Job Status Summary:"
results.each{ k, v -> println "${k}:${v}" }
println "------------------------------------"
}

This yields properly the job names but not job statuses:

12:22:41 Job Status Summary:
[Pipeline] echo
12:22:41 10.4_test_foundation_win:null
[Pipeline] echo
12:22:41 10.4_test_foundation_linux:null
[Pipeline] echo
12:22:41 10.4_test_client_win:null
[Pipeline] echo
12:22:41 10.4_test_client_linux:null
[Pipeline] echo
12:22:41 10.4_test_base_linux:null
[Pipeline] echo
12:22:41 10.4_test_base_win:null
[Pipeline] echo
12:22:41 10.4_test_admin_api_win:null
[Pipeline] echo
12:22:41 10.4_test_admin_api_linux:null
[Pipeline] echo
12:22:41 10.4_test_admin_api_cluster_win:null
[Pipeline] echo
12:22:41 10.4_test_admin_api_cluster_linux:null
[Pipeline] echo
12:22:41 10.4_test_jms_win:null
[Pipeline] echo
12:22:41 10.4_test_jms_linux:null
[Pipeline] echo
12:22:41 10.4_test_client_tool_linux:null
[Pipeline] echo
12:22:41 10.4_test_client_tool_win:null
[Pipeline] echo
12:22:41 10.4_test_cluster_tool_linux:null
[Pipeline] echo
12:22:41 10.4_test_cluster_tool_win:null
[Pipeline] echo
12:22:41 10.4_test_admin_tool_win:null
[Pipeline] echo
12:22:41 10.4_test_admin_tool_linux:null
[Pipeline] echo
12:22:41 10.4_test_cpp_linux:null
[Pipeline] echo
12:22:41 10.4_test_cpp_win:null
[Pipeline] echo
12:22:41 10.4_test_cpp_osx:null


Could this be because of [wait: true]?

I read different topics that this is the right way to collect the results, but it is not working in my case.

What I am missing?
Reply all
Reply to author
Forward
0 new messages