[JIRA] (JENKINS-45871) Failed test sets all steps to unstable

6 views
Skip to first unread message

andreiebh@gmail.com (JIRA)

unread,
Nov 18, 2019, 8:31:04 AM11/18/19
to jenkinsc...@googlegroups.com
Andrei Gheorghiu reopened an issue
 

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.

Jenkins / Bug JENKINS-45871
Failed test sets all steps to unstable
Change By: Andrei Gheorghiu
Resolution: Duplicate
Status: Closed Reopened
Add Comment Add Comment
 
This message was sent by Atlassian Jira (v7.13.6#713006-sha1:cc4451f)
Atlassian logo

dnusbaum@cloudbees.com (JIRA)

unread,
Mar 9, 2020, 11:31:03 AM3/9/20
to jenkinsc...@googlegroups.com
Devin Nusbaum closed an issue as Duplicate
Change By: Devin Nusbaum
Status: Reopened Closed
Resolution: Duplicate
This message was sent by Atlassian Jira (v7.13.12#713012-sha1:6e07c38)
Atlassian logo

dnusbaum@cloudbees.com (JIRA)

unread,
Mar 9, 2020, 11:31:04 AM3/9/20
to jenkinsc...@googlegroups.com

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 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.

dnusbaum@cloudbees.com (JIRA)

unread,
Mar 9, 2020, 11:32:05 AM3/9/20
to jenkinsc...@googlegroups.com
Devin Nusbaum edited a comment on Bug JENKINS-45871
{quote}
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.
{quote}

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}}.

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

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}}.
 
{quote}

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

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.
Reply all
Reply to author
Forward
0 new messages