Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-38049

FlowExecution.getResult() and FlowExecution.getCauseOfFailure() regression with Pipeline script

XMLWordPrintable

      Given pipeline script:

      pipeline {
          agent label:''
          stages {
              stage ('Build') {
                  sh 'echo1 "Building"'
              }
          }
      }
      

      WorkflowRun.getExecution().getResult() reports Success also WorkflowRun.getExecution().getCauseOfFaulure() returns null.

      This is regression when compared with non-kyoto style pipeline.

      node {
          stage ('Build') {
              sh 'echo1 "Building"'
          }
      }
      

      Above script works correctly where WorkflowRun.getExecution().getResult() as FAILURE and WorkflowRun.getExecution().getCauseOfFaulure() as non null Throwable.

      What it does is that when we are dealing with FlowNodes and trying to determine if stage failed, does not work in this case and ends up reporting SUCCESS of overall run where its in fact was a failure. run.getResult() gives correct value as FAILURE.

      abayer This is the issue I mentioned you over chat.

            abayer Andrew Bayer
            vivek Vivek Pandey
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: