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

Failed test sets all steps to unstable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Minor
    • Resolution: Duplicate
    • Labels:
      None
    • Environment:
      Jenkins 2.60.2
      Blue Ocean plugin1.15
      JUnit plugin 1.20
      Pipeline plugin 2.5
    • Similar Issues:

      Description

      In pipeline job with a stage that calls junit plugin to report test results. If there is a failed test, all the stages in the pipeline are marked as unstable. The problem is that the successful/failed result of all the other test stages are lost.

      I think only the step calling junit should be set as unstable, as well as the job reuslt.

        Attachments

          Issue Links

            Activity

            Hide
            jamesdumay James Dumay added a comment -

            Thanks for filing Alberto Sanchez. Good news is that we are working on the infrastructure changes to fix this. Watch JENKINS-39203 for updates.

            Show
            jamesdumay James Dumay added a comment - Thanks for filing Alberto Sanchez . Good news is that we are working on the infrastructure changes to fix this. Watch JENKINS-39203 for updates.
            Hide
            adghdev Andrei Gheorghiu added a comment -

            The implementation for this is awkward. The junit step does indeed set the stage status to UNSTABLE, but it also quickly sets the whole build status to UNSTABLE.

            As Jenkins build status can only be changed down (UNSTABLE can not be reverted/changed to SUCCESSFUL, but only to FAILED), this implementation limits functionality. Can the junit plugin only change the status for the stage it is called in? When changing the whole build status to UNSTABLE, the fact that it also changed the stage status is not visible anyway.

            Show
            adghdev Andrei Gheorghiu added a comment - The implementation for this is awkward. The junit step does indeed set the stage status to UNSTABLE, but it also quickly sets the whole build status to UNSTABLE. As Jenkins build status can only be changed down (UNSTABLE can not be reverted/changed to SUCCESSFUL, but only to FAILED), this implementation limits functionality. Can the junit plugin only change the status for the stage it is called in? When changing the whole build status to UNSTABLE, the fact that it also changed the stage status is not visible anyway.
            Hide
            dnusbaum Devin Nusbaum added a comment - - edited

            The implementation for this is awkward. The junit step does indeed set the stage status to UNSTABLE, but it also quickly sets the whole build status to UNSTABLE.

            Indeed, there is not really any easy way to truly fix the issue, so the reality is that there are multiple kinds of "results" in Pipelines: Run.getResult, ErrorAction, and now WarningAction.

            Can the junit plugin only change the status for the stage it is called in?

            The main reason why we couldn't do something like that is that it would be a breaking change for everyone that currently checks things like currentBuild.currentResult inside of the Pipeline. Step-level "results" handled via WarningAction have no relation to that result, and there is no easy way to fix that, because we need a FlowNode context to get a WarningAction, which cannot be provided by currentBuild.currentResult.
             

            When changing the whole build status to UNSTABLE, the fact that it also changed the stage status is not visible anyway.

            As far as I know, in Blue Ocean and the Pipeline Steps view, the overall build result no longer changes the displayed result for individual steps and stages.

            If you are talking about Pipeline Stage View, then yes, that plugin needs to be updated to use WarningAction correctly, that is tracked as JENKINS-58783.

            Show
            dnusbaum Devin Nusbaum added a comment - - edited The implementation for this is awkward. The junit step does indeed set the stage status to UNSTABLE, but it also quickly sets the whole build status to UNSTABLE. Indeed, there is not really any easy way to truly fix the issue, so the reality is that there are multiple kinds of "results" in Pipelines: Run.getResult , ErrorAction , and now WarningAction . Can the junit plugin only change the status for the stage it is called in? The main reason why we couldn't do something like that is that it would be a breaking change for everyone that currently checks things like currentBuild.currentResult inside of the Pipeline. Step-level "results" handled via WarningAction have no relation to that result, and there is no easy way to fix that, because we need a FlowNode context to get a WarningAction , which cannot be provided by currentBuild.currentResult .   When changing the whole build status to UNSTABLE, the fact that it also changed the stage status is not visible anyway. As far as I know, in Blue Ocean and the Pipeline Steps view, the overall build result no longer changes the displayed result for individual steps and stages. If you are talking about Pipeline Stage View, then yes, that plugin needs to be updated to use WarningAction correctly, that is tracked as JENKINS-58783 .

              People

              • Assignee:
                Unassigned
                Reporter:
                albertosavila Alberto Sanchez
              • Votes:
                1 Vote for this issue
                Watchers:
                7 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: