[JIRA] (JENKINS-53923) Collecting build job results using [.result] property returns null

4 views
Skip to first unread message

vasilena.treneva@softwareag.com (JIRA)

unread,
Oct 5, 2018, 9:00:02 AM10/5/18
to jenkinsc...@googlegroups.com
Vassilena Treneva updated an issue
 
Jenkins / Bug JENKINS-53923
Collecting build job results using [.result] property returns null
Change By: Vassilena Treneva
Attachment: pipelineBuilder.groovy
Add Comment Add Comment
 
This message was sent by Atlassian Jira (v7.11.2#711002-sha1:fdc329d)

vasilena.treneva@softwareag.com (JIRA)

unread,
Oct 5, 2018, 9:00:02 AM10/5/18
to jenkinsc...@googlegroups.com
Vassilena Treneva created an issue
Issue Type: Bug Bug
Assignee: Daniel Spilker
Attachments: pipelineBuilder.groovy
Components: job-dsl-plugin, pipeline, pipeline-model-definition-plugin, pipeline-stage-step-plugin
Created: 2018-10-05 12:59
Environment: Jenkins ver. 2.140
Priority: Minor Minor
Reporter: Vassilena Treneva

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}", description: 'svn repository url'),
string(name: 'buildmajor', value: '10', description: 'release major identifier'),
string(name: 'buildminor', value: '4', description: 'release minor identifier'),
string(name: 'fix', value: "${env.fix}", description: 'fix level'),
string(name: 'buildnumber', value: "${env.buildNumber}", description: 'artifacts build number'),
string(name: 'revision', value: "${env.buildNumber}", description: 'checkout revision'),
string(name: 'joblabel', value: "${pipelineName}", description: "optional job description")
], 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]? What is wrong?

According to the documentation here: https://jenkins.io/doc/pipeline/steps/pipeline-build-step/ I should be able to collect the statuses exactly like this.

andrew.bayer@gmail.com (JIRA)

unread,
Oct 5, 2018, 9:26:03 PM10/5/18
to jenkinsc...@googlegroups.com
Andrew Bayer assigned an issue to Unassigned
Change By: Andrew Bayer
Component/s: pipeline-build-step-plugin
Component/s: job-dsl-plugin
Component/s: pipeline
Component/s: pipeline-model-definition-plugin
Component/s: pipeline-stage-step-plugin
Assignee: Daniel Spilker

vasilena.treneva@softwareag.com (JIRA)

unread,
Oct 12, 2018, 8:38:03 AM10/12/18
to jenkinsc...@googlegroups.com

vasilena.treneva@softwareag.com (JIRA)

unread,
Oct 12, 2018, 8:41:01 AM10/12/18
to jenkinsc...@googlegroups.com

ovidiu.b13@gmail.com (JIRA)

unread,
Jun 13, 2019, 5:34:02 PM6/13/19
to jenkinsc...@googlegroups.com
Ovidiu-Florin Bogdan updated an issue
I would like to collect all triggered jobs results.
My script looks like this:


{code:groovy}
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}", description: 'svn repository url'),
       string(name: 'buildmajor', value: '10', description: 'release major identifier'),
       string(name: 'buildminor', value: '4', description: 'release minor identifier'),
       string(name: 'fix', value: "${env.fix}", description: 'fix level'),
       string(name: 'buildnumber', value: "${env.buildNumber}", description: 'artifacts build number'),
       string(name: 'revision', value: "${env.buildNumber}", description: 'checkout revision'),
       string(name: 'joblabel', value: "${pipelineName}", description: "optional job description")
      ], quietPeriod: 0, propagate: false, wait: true).result
    }
    childJobName = "${nirvanaMajor}.${nirvanaMinor}_${i}"
    results.put(childJobName, childJob)
   }
   parallel jobs
  }
}
}
{code}



In the post section of the pipeline I have this:


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


This yields properly the job names but not job statuses:


{noformat}
{noformat}


Could this be because of [wait: true]? What is wrong?

According to the documentation here: https://jenkins.io/doc/pipeline/steps/pipeline-build-step/ I should be able to collect the statuses exactly like this.

kurde.markus@gmail.com (JIRA)

unread,
Oct 21, 2019, 5:49:04 AM10/21/19
to jenkinsc...@googlegroups.com
Markus Kurde assigned an issue to Markus Kurde
Change By: Markus Kurde
Assignee: Andrew Bayer Markus Kurde
This message was sent by Atlassian Jira (v7.13.6#713006-sha1:cc4451f)
Atlassian logo

kurde.markus@gmail.com (JIRA)

unread,
Oct 21, 2019, 6:00:02 AM10/21/19
to jenkinsc...@googlegroups.com
Markus Kurde commented on Bug JENKINS-53923
 
Re: Collecting build job results using [.result] property returns null

This is not a bug, this is a feature.

See the comments in this Task:  JENKINS-48475

Reply all
Reply to author
Forward
0 new messages