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

Step to set stage or parallel status

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Reopened (View Workflow)
    • Priority: Critical
    • Resolution: Unresolved
    • Component/s: blueocean-plugin, pipeline
    • Labels:
      None
    • Environment:
      Jenkins LTS v2.46.3
      Pipeline plugin v2.5
      Blue Ocean v1.1.4
    • Similar Issues:
    • Released As:
      Pipeline: Basic Steps 2.16

      Description

      Problem
      There is no way to catch a failing block, mark it as "failed" with a user defined description and continue execution of the Pipeline.

      In the example below, the Optional Tests stage would always be successful.

      stage ('Optional Tests') {
              try {
                  echo "Running optional tests..."
                  sh 'exit -1'
              } catch (Exception err) {
                  echo 'Optional tests failed... don't propagate failure'
              }
      }
      

      Solution
      Introduce new steps that can set the state of the stage to UNSTABLE, FAILED, SUCCESS, ABORTED. The message specified would be visible on the UI in Blue Ocean.

      Example

      stage ('Optional Tests') {
              try {
                  echo "Running optional tests..."
                  sh 'exit -1'
              } catch (Exception err) {
                  unstable 'Optional tests failed... don't propagate failure'
              }
      }
      

      Notes

      • There is precedence here with the error signal step.
      • To ensure consistency the FAILED state should always fail the pipeline.
      • The UNSTABLE state is used by tests to mark a stage as problematic but allows execution of the Pipeline to continue.
      • Unstable should be expanded to handle the case where the intent of the Pipeline author is to record that there was a problem with the execution of the stage but execution is allowed to continue.

      Original Request
      I recently discovered that pipeline stages that are run in parallel which report different results from one another are not currently being displayed correctly in the Blue Ocean UI. Here is a short snippet of code that reproduces the problem case I found:

      node {
          parallel testA: {
              stage ("Required Tests") {
                  echo "Running required tests..."
              }
          }, testB: {
              try {
                  stage ("Optional Tests") {
                      echo "Running optional tests..."
                      sh 'exit -1'
                  }
              } catch (Exception err) {
                  echo "Optional tests failed... don't propagate failure"
              }
          }
          
          stage ("Deploy") {
              echo "Deploying..."
          }
      }
      

      Here I expect that 2 dummy test suites will be executed, one containing important tests that must all pass, and another containing less important tests that may be allowed to fail. Following these 2 parallel test stages is a final deploy stage that would be run afterwards so long as the "important" tests complete successfully.

      In this example I'd expect that the node in the pipeline graph for the 'testB' stage would show up red while the other 2 nodes would show up green. Currently this does not happen - all 3 stages show up as green. I've attached a sample screenshot to illustrate the results.

      It is also worth mentioning that the statuses of these stages does appear to be represented correctly in the old 'stage view' from the default Jenkins UI. I've attached a screenshot illustrating this as well.

        Attachments

          Issue Links

            Activity

            leedega Kevin Phillips created issue -
            leedega Kevin Phillips made changes -
            Field Original Value New Value
            Attachment Screen Shot 2017-07-17 at 12.46.53 PM.png [ 38914 ]
            leedega Kevin Phillips made changes -
            Link This issue relates to JENKINS-43995 [ JENKINS-43995 ]
            leedega Kevin Phillips made changes -
            Link This issue relates to JENKINS-39203 [ JENKINS-39203 ]
            leedega Kevin Phillips made changes -
            leedega Kevin Phillips made changes -
            leedega Kevin Phillips made changes -
            Description I recently discovered that pipeline stages that are run in parallel which report different results from one another are not currently being displayed correctly in the Blue Ocean UI. Here is a short snippet of code that reproduces the problem case I found:

            {code}
            node {
                parallel testA: {
                    stage ("Required Tests") {
                        echo "Running required tests..."
                    }
                }, testB: {
                    try {
                        stage ("Optional Tests") {
                            echo "Running optional tests..."
                            sh 'exit -1'
                        }
                    } catch (Exception err) {
                        echo "Optional tests failed... don't propagate failure"
                    }
                }
                
                stage ("Deploy") {
                    echo "Deploying..."
                }
            }
            {code}


            Here I expect that 2 dummy test suites will be executed, one containing important tests that must all pass, and another containing less important tests that may be allowed to fail. Following these 2 parallel test stages is a final deploy stage that would be run afterwards so long as the "important" tests complete successfully.

            In this example I'd expect that the node in the pipeline graph for the 'testB' stage would show up red while the other 2 nodes would show up green. Currently this does not happen - all 3 stages show up as green. I've attache a sample screenshot to illustrate the results.

            It is also worth mentioning that the statuses of these stages does appear to be represented correctly in the old 'stage view' from the default Jenkins UI. I've attached a screenshot illustrating this as well.
            I recently discovered that pipeline stages that are run in parallel which report different results from one another are not currently being displayed correctly in the Blue Ocean UI. Here is a short snippet of code that reproduces the problem case I found:
            {code:java}
            node {
                parallel testA: {
                    stage ("Required Tests") {
                        echo "Running required tests..."
                    }
                }, testB: {
                    try {
                        stage ("Optional Tests") {
                            echo "Running optional tests..."
                            sh 'exit -1'
                        }
                    } catch (Exception err) {
                        echo "Optional tests failed... don't propagate failure"
                    }
                }
                
                stage ("Deploy") {
                    echo "Deploying..."
                }
            }
            {code}
            Here I expect that 2 dummy test suites will be executed, one containing important tests that must all pass, and another containing less important tests that may be allowed to fail. Following these 2 parallel test stages is a final deploy stage that would be run afterwards so long as the "important" tests complete successfully.

            In this example I'd expect that the node in the pipeline graph for the 'testB' stage would show up red while the other 2 nodes would show up green. Currently this does not happen - all 3 stages show up as green. I've attached a sample screenshot to illustrate the results.

            !Screen Shot 2017-07-17 at 12.46.43 PM.png|thumbnail!

            It is also worth mentioning that the statuses of these stages does appear to be represented correctly in the old 'stage view' from the default Jenkins UI. I've attached a screenshot illustrating this as well.

            !Screen Shot 2017-07-17 at 12.46.53 PM.png|thumbnail!
            jamesdumay James Dumay made changes -
            Status Open [ 1 ] Resolved [ 5 ]
            Resolution Not A Defect [ 7 ]
            jamesdumay James Dumay made changes -
            Resolution Not A Defect [ 7 ]
            Status Resolved [ 5 ] Reopened [ 4 ]
            jamesdumay James Dumay made changes -
            Component/s blueocean-plugin [ 21481 ]
            jamesdumay James Dumay made changes -
            Description I recently discovered that pipeline stages that are run in parallel which report different results from one another are not currently being displayed correctly in the Blue Ocean UI. Here is a short snippet of code that reproduces the problem case I found:
            {code:java}
            node {
                parallel testA: {
                    stage ("Required Tests") {
                        echo "Running required tests..."
                    }
                }, testB: {
                    try {
                        stage ("Optional Tests") {
                            echo "Running optional tests..."
                            sh 'exit -1'
                        }
                    } catch (Exception err) {
                        echo "Optional tests failed... don't propagate failure"
                    }
                }
                
                stage ("Deploy") {
                    echo "Deploying..."
                }
            }
            {code}
            Here I expect that 2 dummy test suites will be executed, one containing important tests that must all pass, and another containing less important tests that may be allowed to fail. Following these 2 parallel test stages is a final deploy stage that would be run afterwards so long as the "important" tests complete successfully.

            In this example I'd expect that the node in the pipeline graph for the 'testB' stage would show up red while the other 2 nodes would show up green. Currently this does not happen - all 3 stages show up as green. I've attached a sample screenshot to illustrate the results.

            !Screen Shot 2017-07-17 at 12.46.43 PM.png|thumbnail!

            It is also worth mentioning that the statuses of these stages does appear to be represented correctly in the old 'stage view' from the default Jenkins UI. I've attached a screenshot illustrating this as well.

            !Screen Shot 2017-07-17 at 12.46.53 PM.png|thumbnail!
            *Problem*
            I recently discovered that pipeline stages that are run in parallel which report different results from one another are not currently being displayed correctly in the Blue Ocean UI. Here is a short snippet of code that reproduces the problem case I found:
            {code:java}
            node {
                parallel testA: {
                    stage ("Required Tests") {
                        echo "Running required tests..."
                    }
                }, testB: {
                    try {
                        stage ("Optional Tests") {
                            echo "Running optional tests..."
                            sh 'exit -1'
                        }
                    } catch (Exception err) {
                        echo "Optional tests failed... don't propagate failure"
                    }
                }
                
                stage ("Deploy") {
                    echo "Deploying..."
                }
            }
            {code}
            Here I expect that 2 dummy test suites will be executed, one containing important tests that must all pass, and another containing less important tests that may be allowed to fail. Following these 2 parallel test stages is a final deploy stage that would be run afterwards so long as the "important" tests complete successfully.

            In this example I'd expect that the node in the pipeline graph for the 'testB' stage would show up red while the other 2 nodes would show up green. Currently this does not happen - all 3 stages show up as green. I've attached a sample screenshot to illustrate the results.

            !Screen Shot 2017-07-17 at 12.46.43 PM.png|thumbnail!

            It is also worth mentioning that the statuses of these stages does appear to be represented correctly in the old 'stage view' from the default Jenkins UI. I've attached a screenshot illustrating this as well.

            !Screen Shot 2017-07-17 at 12.46.53 PM.png|thumbnail!
            jglick Jesse Glick made changes -
            Component/s blueocean-plugin [ 21481 ]
            Component/s pipeline [ 21692 ]
            jamesdumay James Dumay made changes -
            Summary Parallel stages not reporting correct status Mark a stage as unstable when catching error
            Component/s pipeline [ 21692 ]
            Description *Problem*
            I recently discovered that pipeline stages that are run in parallel which report different results from one another are not currently being displayed correctly in the Blue Ocean UI. Here is a short snippet of code that reproduces the problem case I found:
            {code:java}
            node {
                parallel testA: {
                    stage ("Required Tests") {
                        echo "Running required tests..."
                    }
                }, testB: {
                    try {
                        stage ("Optional Tests") {
                            echo "Running optional tests..."
                            sh 'exit -1'
                        }
                    } catch (Exception err) {
                        echo "Optional tests failed... don't propagate failure"
                    }
                }
                
                stage ("Deploy") {
                    echo "Deploying..."
                }
            }
            {code}
            Here I expect that 2 dummy test suites will be executed, one containing important tests that must all pass, and another containing less important tests that may be allowed to fail. Following these 2 parallel test stages is a final deploy stage that would be run afterwards so long as the "important" tests complete successfully.

            In this example I'd expect that the node in the pipeline graph for the 'testB' stage would show up red while the other 2 nodes would show up green. Currently this does not happen - all 3 stages show up as green. I've attached a sample screenshot to illustrate the results.

            !Screen Shot 2017-07-17 at 12.46.43 PM.png|thumbnail!

            It is also worth mentioning that the statuses of these stages does appear to be represented correctly in the old 'stage view' from the default Jenkins UI. I've attached a screenshot illustrating this as well.

            !Screen Shot 2017-07-17 at 12.46.53 PM.png|thumbnail!
            *Analysis*
            To ensure consistency the FAILED state should fail the pipeline. The UNSTABLE state is used by tests to mark a stage as problematic but allows execution of the Pipeline to continue. Unstable should be expanded to handle the case where the intent of the Pipeline author is to record that there was a problem with the execution of the stage but execution is allowed to continue.

            *Solution*
            Introduce a new step that can set the state of the stage to UNSTABLE. There is precedence here with the {{error}} signal step.

            The ability to have a step set the stage to UNSTABLE depends on the completion of JENKINS-39203.

            *Problem*
            I recently discovered that pipeline stages that are run in parallel which report different results from one another are not currently being displayed correctly in the Blue Ocean UI. Here is a short snippet of code that reproduces the problem case I found:
            {code:java}
            node {
                parallel testA: {
                    stage ("Required Tests") {
                        echo "Running required tests..."
                    }
                }, testB: {
                    try {
                        stage ("Optional Tests") {
                            echo "Running optional tests..."
                            sh 'exit -1'
                        }
                    } catch (Exception err) {
                        echo "Optional tests failed... don't propagate failure"
                    }
                }
                
                stage ("Deploy") {
                    echo "Deploying..."
                }
            }
            {code}
            Here I expect that 2 dummy test suites will be executed, one containing important tests that must all pass, and another containing less important tests that may be allowed to fail. Following these 2 parallel test stages is a final deploy stage that would be run afterwards so long as the "important" tests complete successfully.

            In this example I'd expect that the node in the pipeline graph for the 'testB' stage would show up red while the other 2 nodes would show up green. Currently this does not happen - all 3 stages show up as green. I've attached a sample screenshot to illustrate the results.

            !Screen Shot 2017-07-17 at 12.46.43 PM.png|thumbnail!

            It is also worth mentioning that the statuses of these stages does appear to be represented correctly in the old 'stage view' from the default Jenkins UI. I've attached a screenshot illustrating this as well.

            !Screen Shot 2017-07-17 at 12.46.53 PM.png|thumbnail!
            jamesdumay James Dumay made changes -
            Issue Type Bug [ 1 ] Improvement [ 4 ]
            jamesdumay James Dumay made changes -
            Epic Link JENKINS-43952 [ 181484 ]
            jamesdumay James Dumay made changes -
            Description *Analysis*
            To ensure consistency the FAILED state should fail the pipeline. The UNSTABLE state is used by tests to mark a stage as problematic but allows execution of the Pipeline to continue. Unstable should be expanded to handle the case where the intent of the Pipeline author is to record that there was a problem with the execution of the stage but execution is allowed to continue.

            *Solution*
            Introduce a new step that can set the state of the stage to UNSTABLE. There is precedence here with the {{error}} signal step.

            The ability to have a step set the stage to UNSTABLE depends on the completion of JENKINS-39203.

            *Problem*
            I recently discovered that pipeline stages that are run in parallel which report different results from one another are not currently being displayed correctly in the Blue Ocean UI. Here is a short snippet of code that reproduces the problem case I found:
            {code:java}
            node {
                parallel testA: {
                    stage ("Required Tests") {
                        echo "Running required tests..."
                    }
                }, testB: {
                    try {
                        stage ("Optional Tests") {
                            echo "Running optional tests..."
                            sh 'exit -1'
                        }
                    } catch (Exception err) {
                        echo "Optional tests failed... don't propagate failure"
                    }
                }
                
                stage ("Deploy") {
                    echo "Deploying..."
                }
            }
            {code}
            Here I expect that 2 dummy test suites will be executed, one containing important tests that must all pass, and another containing less important tests that may be allowed to fail. Following these 2 parallel test stages is a final deploy stage that would be run afterwards so long as the "important" tests complete successfully.

            In this example I'd expect that the node in the pipeline graph for the 'testB' stage would show up red while the other 2 nodes would show up green. Currently this does not happen - all 3 stages show up as green. I've attached a sample screenshot to illustrate the results.

            !Screen Shot 2017-07-17 at 12.46.43 PM.png|thumbnail!

            It is also worth mentioning that the statuses of these stages does appear to be represented correctly in the old 'stage view' from the default Jenkins UI. I've attached a screenshot illustrating this as well.

            !Screen Shot 2017-07-17 at 12.46.53 PM.png|thumbnail!
            *Analysis*
            To ensure consistency the FAILED state should fail the pipeline. The UNSTABLE state is used by tests to mark a stage as problematic but allows execution of the Pipeline to continue. Unstable should be expanded to handle the case where the intent of the Pipeline author is to record that there was a problem with the execution of the stage but execution is allowed to continue.

            *Solution*
            Introduce a new step that can set the state of the stage to UNSTABLE. There is precedence here with the {{error}} signal step.

            The ability to have a step set the stage to UNSTABLE depends on the completion of JENKINS-39203.

            _Example_
            {code}
            stage ('Optional Tests') {
                    try {
                        echo "Running optional tests..."
                        sh 'exit -1'
                    } catch (Exception err) {
                        unstable 'Optional tests failed... don't propagate failure'
                    }
            }
            {code}

            *Problem*
            I recently discovered that pipeline stages that are run in parallel which report different results from one another are not currently being displayed correctly in the Blue Ocean UI. Here is a short snippet of code that reproduces the problem case I found:
            {code:java}
            node {
                parallel testA: {
                    stage ("Required Tests") {
                        echo "Running required tests..."
                    }
                }, testB: {
                    try {
                        stage ("Optional Tests") {
                            echo "Running optional tests..."
                            sh 'exit -1'
                        }
                    } catch (Exception err) {
                        echo "Optional tests failed... don't propagate failure"
                    }
                }
                
                stage ("Deploy") {
                    echo "Deploying..."
                }
            }
            {code}
            Here I expect that 2 dummy test suites will be executed, one containing important tests that must all pass, and another containing less important tests that may be allowed to fail. Following these 2 parallel test stages is a final deploy stage that would be run afterwards so long as the "important" tests complete successfully.

            In this example I'd expect that the node in the pipeline graph for the 'testB' stage would show up red while the other 2 nodes would show up green. Currently this does not happen - all 3 stages show up as green. I've attached a sample screenshot to illustrate the results.

            !Screen Shot 2017-07-17 at 12.46.43 PM.png|thumbnail!

            It is also worth mentioning that the statuses of these stages does appear to be represented correctly in the old 'stage view' from the default Jenkins UI. I've attached a screenshot illustrating this as well.

            !Screen Shot 2017-07-17 at 12.46.53 PM.png|thumbnail!
            jamesdumay James Dumay made changes -
            Description *Analysis*
            To ensure consistency the FAILED state should fail the pipeline. The UNSTABLE state is used by tests to mark a stage as problematic but allows execution of the Pipeline to continue. Unstable should be expanded to handle the case where the intent of the Pipeline author is to record that there was a problem with the execution of the stage but execution is allowed to continue.

            *Solution*
            Introduce a new step that can set the state of the stage to UNSTABLE. There is precedence here with the {{error}} signal step.

            The ability to have a step set the stage to UNSTABLE depends on the completion of JENKINS-39203.

            _Example_
            {code}
            stage ('Optional Tests') {
                    try {
                        echo "Running optional tests..."
                        sh 'exit -1'
                    } catch (Exception err) {
                        unstable 'Optional tests failed... don't propagate failure'
                    }
            }
            {code}

            *Problem*
            I recently discovered that pipeline stages that are run in parallel which report different results from one another are not currently being displayed correctly in the Blue Ocean UI. Here is a short snippet of code that reproduces the problem case I found:
            {code:java}
            node {
                parallel testA: {
                    stage ("Required Tests") {
                        echo "Running required tests..."
                    }
                }, testB: {
                    try {
                        stage ("Optional Tests") {
                            echo "Running optional tests..."
                            sh 'exit -1'
                        }
                    } catch (Exception err) {
                        echo "Optional tests failed... don't propagate failure"
                    }
                }
                
                stage ("Deploy") {
                    echo "Deploying..."
                }
            }
            {code}
            Here I expect that 2 dummy test suites will be executed, one containing important tests that must all pass, and another containing less important tests that may be allowed to fail. Following these 2 parallel test stages is a final deploy stage that would be run afterwards so long as the "important" tests complete successfully.

            In this example I'd expect that the node in the pipeline graph for the 'testB' stage would show up red while the other 2 nodes would show up green. Currently this does not happen - all 3 stages show up as green. I've attached a sample screenshot to illustrate the results.

            !Screen Shot 2017-07-17 at 12.46.43 PM.png|thumbnail!

            It is also worth mentioning that the statuses of these stages does appear to be represented correctly in the old 'stage view' from the default Jenkins UI. I've attached a screenshot illustrating this as well.

            !Screen Shot 2017-07-17 at 12.46.53 PM.png|thumbnail!
            *Problem*
            There is no way to catch a failing block, mark it as "failed" with a user defined description and continue execution of the Pipeline.

            *Solution*
            Introduce a new step that can set the state of the stage to UNSTABLE. The message specified would be visible on the UI in Blue Ocean.

            The ability to have a step set the stage to UNSTABLE depends on the completion of JENKINS-39203.

            _Example_
            {code}
            stage ('Optional Tests') {
                    try {
                        echo "Running optional tests..."
                        sh 'exit -1'
                    } catch (Exception err) {
                        unstable 'Optional tests failed... don't propagate failure'
                    }
            }
            {code}

            *Notes*
            * There is precedence here with the {{error}} signal step.
            * To ensure consistency the FAILED state should always fail the pipeline.
            * The UNSTABLE state is used by tests to mark a stage as problematic but allows execution of the Pipeline to continue.
            * Unstable should be expanded to handle the case where the intent of the Pipeline author is to record that there was a problem with the execution of the stage but execution is allowed to continue.

            *Problem*
            I recently discovered that pipeline stages that are run in parallel which report different results from one another are not currently being displayed correctly in the Blue Ocean UI. Here is a short snippet of code that reproduces the problem case I found:
            {code:java}
            node {
                parallel testA: {
                    stage ("Required Tests") {
                        echo "Running required tests..."
                    }
                }, testB: {
                    try {
                        stage ("Optional Tests") {
                            echo "Running optional tests..."
                            sh 'exit -1'
                        }
                    } catch (Exception err) {
                        echo "Optional tests failed... don't propagate failure"
                    }
                }
                
                stage ("Deploy") {
                    echo "Deploying..."
                }
            }
            {code}
            Here I expect that 2 dummy test suites will be executed, one containing important tests that must all pass, and another containing less important tests that may be allowed to fail. Following these 2 parallel test stages is a final deploy stage that would be run afterwards so long as the "important" tests complete successfully.

            In this example I'd expect that the node in the pipeline graph for the 'testB' stage would show up red while the other 2 nodes would show up green. Currently this does not happen - all 3 stages show up as green. I've attached a sample screenshot to illustrate the results.

            !Screen Shot 2017-07-17 at 12.46.43 PM.png|thumbnail!

            It is also worth mentioning that the statuses of these stages does appear to be represented correctly in the old 'stage view' from the default Jenkins UI. I've attached a screenshot illustrating this as well.

            !Screen Shot 2017-07-17 at 12.46.53 PM.png|thumbnail!
            jamesdumay James Dumay made changes -
            Description *Problem*
            There is no way to catch a failing block, mark it as "failed" with a user defined description and continue execution of the Pipeline.

            *Solution*
            Introduce a new step that can set the state of the stage to UNSTABLE. The message specified would be visible on the UI in Blue Ocean.

            The ability to have a step set the stage to UNSTABLE depends on the completion of JENKINS-39203.

            _Example_
            {code}
            stage ('Optional Tests') {
                    try {
                        echo "Running optional tests..."
                        sh 'exit -1'
                    } catch (Exception err) {
                        unstable 'Optional tests failed... don't propagate failure'
                    }
            }
            {code}

            *Notes*
            * There is precedence here with the {{error}} signal step.
            * To ensure consistency the FAILED state should always fail the pipeline.
            * The UNSTABLE state is used by tests to mark a stage as problematic but allows execution of the Pipeline to continue.
            * Unstable should be expanded to handle the case where the intent of the Pipeline author is to record that there was a problem with the execution of the stage but execution is allowed to continue.

            *Problem*
            I recently discovered that pipeline stages that are run in parallel which report different results from one another are not currently being displayed correctly in the Blue Ocean UI. Here is a short snippet of code that reproduces the problem case I found:
            {code:java}
            node {
                parallel testA: {
                    stage ("Required Tests") {
                        echo "Running required tests..."
                    }
                }, testB: {
                    try {
                        stage ("Optional Tests") {
                            echo "Running optional tests..."
                            sh 'exit -1'
                        }
                    } catch (Exception err) {
                        echo "Optional tests failed... don't propagate failure"
                    }
                }
                
                stage ("Deploy") {
                    echo "Deploying..."
                }
            }
            {code}
            Here I expect that 2 dummy test suites will be executed, one containing important tests that must all pass, and another containing less important tests that may be allowed to fail. Following these 2 parallel test stages is a final deploy stage that would be run afterwards so long as the "important" tests complete successfully.

            In this example I'd expect that the node in the pipeline graph for the 'testB' stage would show up red while the other 2 nodes would show up green. Currently this does not happen - all 3 stages show up as green. I've attached a sample screenshot to illustrate the results.

            !Screen Shot 2017-07-17 at 12.46.43 PM.png|thumbnail!

            It is also worth mentioning that the statuses of these stages does appear to be represented correctly in the old 'stage view' from the default Jenkins UI. I've attached a screenshot illustrating this as well.

            !Screen Shot 2017-07-17 at 12.46.53 PM.png|thumbnail!
            *Problem*
            There is no way to catch a failing block, mark it as "failed" with a user defined description and continue execution of the Pipeline.

            In the example below, the _Optional Tests_ stage would always be successful.

            {code}
            stage ('Optional Tests') {
                    try {
                        echo "Running optional tests..."
                        sh 'exit -1'
                    } catch (Exception err) {
                        echo 'Optional tests failed... don't propagate failure'
                    }
            }
            {code}

            *Solution*
            Introduce a new step that can set the state of the stage to UNSTABLE. The message specified would be visible on the UI in Blue Ocean.

            The ability to have a step set the stage to UNSTABLE depends on the completion of JENKINS-39203.

            _Example_
            {code}
            stage ('Optional Tests') {
                    try {
                        echo "Running optional tests..."
                        sh 'exit -1'
                    } catch (Exception err) {
                        unstable 'Optional tests failed... don't propagate failure'
                    }
            }
            {code}

            *Notes*
            * There is precedence here with the {{error}} signal step.
            * To ensure consistency the FAILED state should always fail the pipeline.
            * The UNSTABLE state is used by tests to mark a stage as problematic but allows execution of the Pipeline to continue.
            * Unstable should be expanded to handle the case where the intent of the Pipeline author is to record that there was a problem with the execution of the stage but execution is allowed to continue.

            *Problem*
            I recently discovered that pipeline stages that are run in parallel which report different results from one another are not currently being displayed correctly in the Blue Ocean UI. Here is a short snippet of code that reproduces the problem case I found:
            {code:java}
            node {
                parallel testA: {
                    stage ("Required Tests") {
                        echo "Running required tests..."
                    }
                }, testB: {
                    try {
                        stage ("Optional Tests") {
                            echo "Running optional tests..."
                            sh 'exit -1'
                        }
                    } catch (Exception err) {
                        echo "Optional tests failed... don't propagate failure"
                    }
                }
                
                stage ("Deploy") {
                    echo "Deploying..."
                }
            }
            {code}
            Here I expect that 2 dummy test suites will be executed, one containing important tests that must all pass, and another containing less important tests that may be allowed to fail. Following these 2 parallel test stages is a final deploy stage that would be run afterwards so long as the "important" tests complete successfully.

            In this example I'd expect that the node in the pipeline graph for the 'testB' stage would show up red while the other 2 nodes would show up green. Currently this does not happen - all 3 stages show up as green. I've attached a sample screenshot to illustrate the results.

            !Screen Shot 2017-07-17 at 12.46.43 PM.png|thumbnail!

            It is also worth mentioning that the statuses of these stages does appear to be represented correctly in the old 'stage view' from the default Jenkins UI. I've attached a screenshot illustrating this as well.

            !Screen Shot 2017-07-17 at 12.46.53 PM.png|thumbnail!
            jamesdumay James Dumay made changes -
            Description *Problem*
            There is no way to catch a failing block, mark it as "failed" with a user defined description and continue execution of the Pipeline.

            In the example below, the _Optional Tests_ stage would always be successful.

            {code}
            stage ('Optional Tests') {
                    try {
                        echo "Running optional tests..."
                        sh 'exit -1'
                    } catch (Exception err) {
                        echo 'Optional tests failed... don't propagate failure'
                    }
            }
            {code}

            *Solution*
            Introduce a new step that can set the state of the stage to UNSTABLE. The message specified would be visible on the UI in Blue Ocean.

            The ability to have a step set the stage to UNSTABLE depends on the completion of JENKINS-39203.

            _Example_
            {code}
            stage ('Optional Tests') {
                    try {
                        echo "Running optional tests..."
                        sh 'exit -1'
                    } catch (Exception err) {
                        unstable 'Optional tests failed... don't propagate failure'
                    }
            }
            {code}

            *Notes*
            * There is precedence here with the {{error}} signal step.
            * To ensure consistency the FAILED state should always fail the pipeline.
            * The UNSTABLE state is used by tests to mark a stage as problematic but allows execution of the Pipeline to continue.
            * Unstable should be expanded to handle the case where the intent of the Pipeline author is to record that there was a problem with the execution of the stage but execution is allowed to continue.

            *Problem*
            I recently discovered that pipeline stages that are run in parallel which report different results from one another are not currently being displayed correctly in the Blue Ocean UI. Here is a short snippet of code that reproduces the problem case I found:
            {code:java}
            node {
                parallel testA: {
                    stage ("Required Tests") {
                        echo "Running required tests..."
                    }
                }, testB: {
                    try {
                        stage ("Optional Tests") {
                            echo "Running optional tests..."
                            sh 'exit -1'
                        }
                    } catch (Exception err) {
                        echo "Optional tests failed... don't propagate failure"
                    }
                }
                
                stage ("Deploy") {
                    echo "Deploying..."
                }
            }
            {code}
            Here I expect that 2 dummy test suites will be executed, one containing important tests that must all pass, and another containing less important tests that may be allowed to fail. Following these 2 parallel test stages is a final deploy stage that would be run afterwards so long as the "important" tests complete successfully.

            In this example I'd expect that the node in the pipeline graph for the 'testB' stage would show up red while the other 2 nodes would show up green. Currently this does not happen - all 3 stages show up as green. I've attached a sample screenshot to illustrate the results.

            !Screen Shot 2017-07-17 at 12.46.43 PM.png|thumbnail!

            It is also worth mentioning that the statuses of these stages does appear to be represented correctly in the old 'stage view' from the default Jenkins UI. I've attached a screenshot illustrating this as well.

            !Screen Shot 2017-07-17 at 12.46.53 PM.png|thumbnail!
            *Problem*
            There is no way to catch a failing block, mark it as "failed" with a user defined description and continue execution of the Pipeline.

            In the example below, the _Optional Tests_ stage would always be successful.

            {code}
            stage ('Optional Tests') {
                    try {
                        echo "Running optional tests..."
                        sh 'exit -1'
                    } catch (Exception err) {
                        echo 'Optional tests failed... don't propagate failure'
                    }
            }
            {code}

            *Solution*
            Introduce a new step that can set the state of the stage to UNSTABLE. The message specified would be visible on the UI in Blue Ocean.

            The ability to have a step set the stage to UNSTABLE depends on the completion of JENKINS-39203.

            _Example_
            {code}
            stage ('Optional Tests') {
                    try {
                        echo "Running optional tests..."
                        sh 'exit -1'
                    } catch (Exception err) {
                        unstable 'Optional tests failed... don't propagate failure'
                    }
            }
            {code}

            *Notes*
            * There is precedence here with the {{error}} signal step.
            * To ensure consistency the FAILED state should always fail the pipeline.
            * The UNSTABLE state is used by tests to mark a stage as problematic but allows execution of the Pipeline to continue.
            * Unstable should be expanded to handle the case where the intent of the Pipeline author is to record that there was a problem with the execution of the stage but execution is allowed to continue.

            *Original Request*
            I recently discovered that pipeline stages that are run in parallel which report different results from one another are not currently being displayed correctly in the Blue Ocean UI. Here is a short snippet of code that reproduces the problem case I found:
            {code:java}
            node {
                parallel testA: {
                    stage ("Required Tests") {
                        echo "Running required tests..."
                    }
                }, testB: {
                    try {
                        stage ("Optional Tests") {
                            echo "Running optional tests..."
                            sh 'exit -1'
                        }
                    } catch (Exception err) {
                        echo "Optional tests failed... don't propagate failure"
                    }
                }
                
                stage ("Deploy") {
                    echo "Deploying..."
                }
            }
            {code}
            Here I expect that 2 dummy test suites will be executed, one containing important tests that must all pass, and another containing less important tests that may be allowed to fail. Following these 2 parallel test stages is a final deploy stage that would be run afterwards so long as the "important" tests complete successfully.

            In this example I'd expect that the node in the pipeline graph for the 'testB' stage would show up red while the other 2 nodes would show up green. Currently this does not happen - all 3 stages show up as green. I've attached a sample screenshot to illustrate the results.

            !Screen Shot 2017-07-17 at 12.46.43 PM.png|thumbnail!

            It is also worth mentioning that the statuses of these stages does appear to be represented correctly in the old 'stage view' from the default Jenkins UI. I've attached a screenshot illustrating this as well.

            !Screen Shot 2017-07-17 at 12.46.53 PM.png|thumbnail!
            jamesdumay James Dumay made changes -
            Sprint Blue Ocean 1.3-beta-1 [ 326 ]
            jamesdumay James Dumay made changes -
            Rank Ranked higher
            jamesdumay James Dumay made changes -
            Assignee Andrew Bayer [ abayer ]
            jamesdumay James Dumay made changes -
            Priority Minor [ 4 ] Major [ 3 ]
            jamesdumay James Dumay made changes -
            Rank Ranked higher
            jamesdumay James Dumay made changes -
            Summary Mark a stage as unstable when catching error Step to set stage or parallel status
            jamesdumay James Dumay made changes -
            Description *Problem*
            There is no way to catch a failing block, mark it as "failed" with a user defined description and continue execution of the Pipeline.

            In the example below, the _Optional Tests_ stage would always be successful.

            {code}
            stage ('Optional Tests') {
                    try {
                        echo "Running optional tests..."
                        sh 'exit -1'
                    } catch (Exception err) {
                        echo 'Optional tests failed... don't propagate failure'
                    }
            }
            {code}

            *Solution*
            Introduce a new step that can set the state of the stage to UNSTABLE. The message specified would be visible on the UI in Blue Ocean.

            The ability to have a step set the stage to UNSTABLE depends on the completion of JENKINS-39203.

            _Example_
            {code}
            stage ('Optional Tests') {
                    try {
                        echo "Running optional tests..."
                        sh 'exit -1'
                    } catch (Exception err) {
                        unstable 'Optional tests failed... don't propagate failure'
                    }
            }
            {code}

            *Notes*
            * There is precedence here with the {{error}} signal step.
            * To ensure consistency the FAILED state should always fail the pipeline.
            * The UNSTABLE state is used by tests to mark a stage as problematic but allows execution of the Pipeline to continue.
            * Unstable should be expanded to handle the case where the intent of the Pipeline author is to record that there was a problem with the execution of the stage but execution is allowed to continue.

            *Original Request*
            I recently discovered that pipeline stages that are run in parallel which report different results from one another are not currently being displayed correctly in the Blue Ocean UI. Here is a short snippet of code that reproduces the problem case I found:
            {code:java}
            node {
                parallel testA: {
                    stage ("Required Tests") {
                        echo "Running required tests..."
                    }
                }, testB: {
                    try {
                        stage ("Optional Tests") {
                            echo "Running optional tests..."
                            sh 'exit -1'
                        }
                    } catch (Exception err) {
                        echo "Optional tests failed... don't propagate failure"
                    }
                }
                
                stage ("Deploy") {
                    echo "Deploying..."
                }
            }
            {code}
            Here I expect that 2 dummy test suites will be executed, one containing important tests that must all pass, and another containing less important tests that may be allowed to fail. Following these 2 parallel test stages is a final deploy stage that would be run afterwards so long as the "important" tests complete successfully.

            In this example I'd expect that the node in the pipeline graph for the 'testB' stage would show up red while the other 2 nodes would show up green. Currently this does not happen - all 3 stages show up as green. I've attached a sample screenshot to illustrate the results.

            !Screen Shot 2017-07-17 at 12.46.43 PM.png|thumbnail!

            It is also worth mentioning that the statuses of these stages does appear to be represented correctly in the old 'stage view' from the default Jenkins UI. I've attached a screenshot illustrating this as well.

            !Screen Shot 2017-07-17 at 12.46.53 PM.png|thumbnail!
            *Problem*
            There is no way to catch a failing block, mark it as "failed" with a user defined description and continue execution of the Pipeline.

            In the example below, the _Optional Tests_ stage would always be successful.

            {code}
            stage ('Optional Tests') {
                    try {
                        echo "Running optional tests..."
                        sh 'exit -1'
                    } catch (Exception err) {
                        echo 'Optional tests failed... don't propagate failure'
                    }
            }
            {code}

            *Solution*
            Introduce new steps that can set the state of the stage to UNSTABLE, FAILED, SUCCESS. The message specified would be visible on the UI in Blue Ocean.

            _Example_
            {code}
            stage ('Optional Tests') {
                    try {
                        echo "Running optional tests..."
                        sh 'exit -1'
                    } catch (Exception err) {
                        unstable 'Optional tests failed... don't propagate failure'
                    }
            }
            {code}

            *Notes*
            * There is precedence here with the {{error}} signal step.
            * To ensure consistency the FAILED state should always fail the pipeline.
            * The UNSTABLE state is used by tests to mark a stage as problematic but allows execution of the Pipeline to continue.
            * Unstable should be expanded to handle the case where the intent of the Pipeline author is to record that there was a problem with the execution of the stage but execution is allowed to continue.

            *Original Request*
            I recently discovered that pipeline stages that are run in parallel which report different results from one another are not currently being displayed correctly in the Blue Ocean UI. Here is a short snippet of code that reproduces the problem case I found:
            {code:java}
            node {
                parallel testA: {
                    stage ("Required Tests") {
                        echo "Running required tests..."
                    }
                }, testB: {
                    try {
                        stage ("Optional Tests") {
                            echo "Running optional tests..."
                            sh 'exit -1'
                        }
                    } catch (Exception err) {
                        echo "Optional tests failed... don't propagate failure"
                    }
                }
                
                stage ("Deploy") {
                    echo "Deploying..."
                }
            }
            {code}
            Here I expect that 2 dummy test suites will be executed, one containing important tests that must all pass, and another containing less important tests that may be allowed to fail. Following these 2 parallel test stages is a final deploy stage that would be run afterwards so long as the "important" tests complete successfully.

            In this example I'd expect that the node in the pipeline graph for the 'testB' stage would show up red while the other 2 nodes would show up green. Currently this does not happen - all 3 stages show up as green. I've attached a sample screenshot to illustrate the results.

            !Screen Shot 2017-07-17 at 12.46.43 PM.png|thumbnail!

            It is also worth mentioning that the statuses of these stages does appear to be represented correctly in the old 'stage view' from the default Jenkins UI. I've attached a screenshot illustrating this as well.

            !Screen Shot 2017-07-17 at 12.46.53 PM.png|thumbnail!
            jamesdumay James Dumay made changes -
            Sprint Blue Ocean 1.4 - candidates [ 326 ] Blue Ocean 1.5 - candidates [ 311 ]
            jamesdumay James Dumay made changes -
            Rank Ranked higher
            jamesdumay James Dumay made changes -
            Sprint Blue Ocean 1.5 - candidates [ 311 ]
            jamesdumay James Dumay made changes -
            Rank Ranked higher
            jamesdumay James Dumay made changes -
            Sprint Pipeline - Candidates [ 381 ]
            jamesdumay James Dumay made changes -
            Epic Link JENKINS-43952 [ 181484 ] JENKINS-45818 [ 184028 ]
            cloudbees CloudBees Inc. made changes -
            Remote Link This issue links to "CloudBees Internal CD-267 (Web Link)" [ 19008 ]
            jamesdumay James Dumay made changes -
            Description *Problem*
            There is no way to catch a failing block, mark it as "failed" with a user defined description and continue execution of the Pipeline.

            In the example below, the _Optional Tests_ stage would always be successful.

            {code}
            stage ('Optional Tests') {
                    try {
                        echo "Running optional tests..."
                        sh 'exit -1'
                    } catch (Exception err) {
                        echo 'Optional tests failed... don't propagate failure'
                    }
            }
            {code}

            *Solution*
            Introduce new steps that can set the state of the stage to UNSTABLE, FAILED, SUCCESS. The message specified would be visible on the UI in Blue Ocean.

            _Example_
            {code}
            stage ('Optional Tests') {
                    try {
                        echo "Running optional tests..."
                        sh 'exit -1'
                    } catch (Exception err) {
                        unstable 'Optional tests failed... don't propagate failure'
                    }
            }
            {code}

            *Notes*
            * There is precedence here with the {{error}} signal step.
            * To ensure consistency the FAILED state should always fail the pipeline.
            * The UNSTABLE state is used by tests to mark a stage as problematic but allows execution of the Pipeline to continue.
            * Unstable should be expanded to handle the case where the intent of the Pipeline author is to record that there was a problem with the execution of the stage but execution is allowed to continue.

            *Original Request*
            I recently discovered that pipeline stages that are run in parallel which report different results from one another are not currently being displayed correctly in the Blue Ocean UI. Here is a short snippet of code that reproduces the problem case I found:
            {code:java}
            node {
                parallel testA: {
                    stage ("Required Tests") {
                        echo "Running required tests..."
                    }
                }, testB: {
                    try {
                        stage ("Optional Tests") {
                            echo "Running optional tests..."
                            sh 'exit -1'
                        }
                    } catch (Exception err) {
                        echo "Optional tests failed... don't propagate failure"
                    }
                }
                
                stage ("Deploy") {
                    echo "Deploying..."
                }
            }
            {code}
            Here I expect that 2 dummy test suites will be executed, one containing important tests that must all pass, and another containing less important tests that may be allowed to fail. Following these 2 parallel test stages is a final deploy stage that would be run afterwards so long as the "important" tests complete successfully.

            In this example I'd expect that the node in the pipeline graph for the 'testB' stage would show up red while the other 2 nodes would show up green. Currently this does not happen - all 3 stages show up as green. I've attached a sample screenshot to illustrate the results.

            !Screen Shot 2017-07-17 at 12.46.43 PM.png|thumbnail!

            It is also worth mentioning that the statuses of these stages does appear to be represented correctly in the old 'stage view' from the default Jenkins UI. I've attached a screenshot illustrating this as well.

            !Screen Shot 2017-07-17 at 12.46.53 PM.png|thumbnail!
            *Problem*
            There is no way to catch a failing block, mark it as "failed" with a user defined description and continue execution of the Pipeline.

            In the example below, the _Optional Tests_ stage would always be successful.

            {code}
            stage ('Optional Tests') {
                    try {
                        echo "Running optional tests..."
                        sh 'exit -1'
                    } catch (Exception err) {
                        echo 'Optional tests failed... don't propagate failure'
                    }
            }
            {code}

            *Solution*
            Introduce new steps that can set the state of the stage to UNSTABLE, FAILED, SUCCESS, ABORTED. The message specified would be visible on the UI in Blue Ocean.

            _Example_
            {code}
            stage ('Optional Tests') {
                    try {
                        echo "Running optional tests..."
                        sh 'exit -1'
                    } catch (Exception err) {
                        unstable 'Optional tests failed... don't propagate failure'
                    }
            }
            {code}

            *Notes*
            * There is precedence here with the {{error}} signal step.
            * To ensure consistency the FAILED state should always fail the pipeline.
            * The UNSTABLE state is used by tests to mark a stage as problematic but allows execution of the Pipeline to continue.
            * Unstable should be expanded to handle the case where the intent of the Pipeline author is to record that there was a problem with the execution of the stage but execution is allowed to continue.

            *Original Request*
            I recently discovered that pipeline stages that are run in parallel which report different results from one another are not currently being displayed correctly in the Blue Ocean UI. Here is a short snippet of code that reproduces the problem case I found:
            {code:java}
            node {
                parallel testA: {
                    stage ("Required Tests") {
                        echo "Running required tests..."
                    }
                }, testB: {
                    try {
                        stage ("Optional Tests") {
                            echo "Running optional tests..."
                            sh 'exit -1'
                        }
                    } catch (Exception err) {
                        echo "Optional tests failed... don't propagate failure"
                    }
                }
                
                stage ("Deploy") {
                    echo "Deploying..."
                }
            }
            {code}
            Here I expect that 2 dummy test suites will be executed, one containing important tests that must all pass, and another containing less important tests that may be allowed to fail. Following these 2 parallel test stages is a final deploy stage that would be run afterwards so long as the "important" tests complete successfully.

            In this example I'd expect that the node in the pipeline graph for the 'testB' stage would show up red while the other 2 nodes would show up green. Currently this does not happen - all 3 stages show up as green. I've attached a sample screenshot to illustrate the results.

            !Screen Shot 2017-07-17 at 12.46.43 PM.png|thumbnail!

            It is also worth mentioning that the statuses of these stages does appear to be represented correctly in the old 'stage view' from the default Jenkins UI. I've attached a screenshot illustrating this as well.

            !Screen Shot 2017-07-17 at 12.46.53 PM.png|thumbnail!
            jamesdumay James Dumay made changes -
            Link This issue is duplicated by JENKINS-27092 [ JENKINS-27092 ]
            cloudbees CloudBees Inc. made changes -
            Remote Link This issue links to "CloudBees Internal CD-378 (Web Link)" [ 19433 ]
            abayer Andrew Bayer made changes -
            Assignee Andrew Bayer [ abayer ]
            abayer Andrew Bayer made changes -
            Link This issue is duplicated by JENKINS-49764 [ JENKINS-49764 ]
            vivek Vivek Pandey made changes -
            Sprint Pipeline - Candidates [ 381 ]
            vivek Vivek Pandey made changes -
            Rank Ranked higher
            wulfgarpro James Fraser made changes -
            Comment [ +1 ]
            nrayapati Naresh Rayapati made changes -
            Rank Ranked higher
            sizgiyaev Sergey Izgiyaev made changes -
            Priority Major [ 3 ] Critical [ 2 ]
            saad_azam Saad Azam made changes -
            Attachment image-2019-04-12-18-20-27-978.png [ 46710 ]
            saad_azam Saad Azam made changes -
            Comment [ I am trying a very simple code with no parallel stage in there yet I can't see the blue motion plugin indicating the failed stage correctly, see my example below:
            {code:java}
            pipeline {
                agent {label "NIGHTLY"}
                stages {
                    stage ('test 1') {
                        steps {
                            sh 'exit 0'
                        }
                    }
                    stage ('test 2') {
                        steps {
                            script {
                                catchError {
                                    sh 'exit -1'
                                }
                            }
                        }
                    }
                    stage ('test 3') {
                        steps {
                            sh 'exit 0'
                        }
                    }
                }
            }
            {code}
            !image-2019-04-12-18-20-27-978.png|width=997,height=400! ]
            dnusbaum Devin Nusbaum made changes -
            Remote Link This issue links to "jenkinsci/workflow-basic-steps-plugin#83 (Web Link)" [ 22916 ]
            dnusbaum Devin Nusbaum made changes -
            Released As Pipeline: Basic Steps 2.16
            dnusbaum Devin Nusbaum made changes -
            Link This issue relates to JENKINS-57537 [ JENKINS-57537 ]
            dnusbaum Devin Nusbaum made changes -
            Link This issue relates to JENKINS-57826 [ JENKINS-57826 ]

              People

              • Assignee:
                Unassigned
                Reporter:
                leedega Kevin Phillips
              • Votes:
                152 Vote for this issue
                Watchers:
                170 Start watching this issue

                Dates

                • Created:
                  Updated: