[JIRA] (JENKINS-14102) Unstable main build leads to post steps being executed even if configured not to

classic Classic list List threaded Threaded
21 messages Options
12
Reply | Threaded
Open this post in threaded view
|

[JIRA] (JENKINS-14102) Unstable main build leads to post steps being executed even if configured not to

JIRA noreply@jenkins-ci.org
Issue Type: Bug Bug
Affects Versions: current
Assignee: abayer
Components: m2-extra-steps
Created: 14/Jun/12 12:43 PM
Description:

When a build "fails" due to test failures, and post steps are configured with the option "Run only if build succeeds", these post steps are still executed.

(Jenkins 1.467)

Project: Jenkins
Priority: Major Major
Reporter: Thomas Demande
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators.
For more information on JIRA, see: http://www.atlassian.com/software/jira
Reply | Threaded
Open this post in threaded view
|

[JIRA] (JENKINS-14102) Unstable main build leads to post steps being executed even if configured not to

JIRA noreply@jenkins-ci.org

I'm having the same issue on my builds.

Please Jenkins' team take about it, it's so annoying .... dev team is complain a lot about it for me.

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators.
For more information on JIRA, see: http://www.atlassian.com/software/jira
Reply | Threaded
Open this post in threaded view
|

[JIRA] (JENKINS-14102) Unstable main build leads to post steps being executed even if configured not to

JIRA noreply@jenkins-ci.org
In reply to this post by JIRA noreply@jenkins-ci.org

The issue is in;
hudson.maven.reporters.SurefireArchiver
(${jenkins}\maven-plugin\src\main\java\hudson\maven\reporters\SurefireArchiver.java)

The awkward behavior since 2010 has been that if a unit test fails that the build is actually a SUCCESS. This has the result of the post steps always running if a unit test has failed.

A potential way to fix this would be to add a configuration option (globally or for the build) that jobs with failed unit tests should not be "markAsSuccess".

Code quality issue;
MavenBuilder.markAsSuccess = true;
Maven3Builder.markAsSuccess = true;
An alternative to public static booleans should probably be found!

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators.
For more information on JIRA, see: http://www.atlassian.com/software/jira
Reply | Threaded
Open this post in threaded view
|

[JIRA] (JENKINS-14102) Unstable main build leads to post steps being executed even if configured not to

JIRA noreply@jenkins-ci.org
In reply to this post by JIRA noreply@jenkins-ci.org
Daniel Haas commented on Bug JENKINS-14102

Hi everyone. I need this bug/feature so much that I'm willing to pay 50.00 bucks for it.
This offer is registered at FreedomSponsors (http://www.freedomsponsors.org/core/issue/51/unstable-main-build-leads-to-post-steps-being-executed-even-if-configured-not-to).
Once you solve it (according to the acceptance criteria described there), just create a FreedomSponsors account and mark it as resolved (oh, you'll need a Paypal account too)
I'll then check it out and will gladly pay up!

If anyone else would like to throw in a few bucks to elevate the priority on this issue, you should check out FreedomSponsors!

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators.
For more information on JIRA, see: http://www.atlassian.com/software/jira
Reply | Threaded
Open this post in threaded view
|

[JIRA] (JENKINS-14102) Unstable main build leads to post steps being executed even if configured not to

JIRA noreply@jenkins-ci.org
In reply to this post by JIRA noreply@jenkins-ci.org
Peter S commented on Bug JENKINS-14102

please give more details - which post builds steps you use? or provide <publishers> section content of job's xml config file

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators.
For more information on JIRA, see: http://www.atlassian.com/software/jira
Reply | Threaded
Open this post in threaded view
|

[JIRA] (JENKINS-14102) Unstable main build leads to post steps being executed even if configured not to

JIRA noreply@jenkins-ci.org
In reply to this post by JIRA noreply@jenkins-ci.org
 
Peter S edited a comment on Bug JENKINS-14102

please give more details - which post-build steps you use? or provide <publishers> section content of job's xml config file

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators.
For more information on JIRA, see: http://www.atlassian.com/software/jira
Reply | Threaded
Open this post in threaded view
|

[JIRA] (JENKINS-14102) Unstable main build leads to post steps being executed even if configured not to

JIRA noreply@jenkins-ci.org
In reply to this post by JIRA noreply@jenkins-ci.org
Daniel Haas commented on Bug JENKINS-14102

I'm executing a shell script afterwards. Actually what it is it should test first my build (maven build) and if the tests fail the script should be not executed.
I put it into the Post Steps...

Actually publishers is empty:

<publishers/>

There are stored postbuilders:

<postbuilders>
<hudson.tasks.Shell>
<command>env && ./jdeploy $Server</command>
</hudson.tasks.Shell>
</postbuilders>

In the jenkins web interface it is:

Post Steps
Run only if build succeeds
Run only if build succeeds or is unstable
Run regardless of build result

Should the post-build steps run only for successful builds, etc.

Execute shell

Command env && ./jdeploy $Server

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators.
For more information on JIRA, see: http://www.atlassian.com/software/jira
Reply | Threaded
Open this post in threaded view
|

[JIRA] (JENKINS-14102) Unstable main build leads to post steps being executed even if configured not to

JIRA noreply@jenkins-ci.org
In reply to this post by JIRA noreply@jenkins-ci.org

I'm using "Invoke top-level Maven targets" post steps.

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators.
For more information on JIRA, see: http://www.atlassian.com/software/jira
Reply | Threaded
Open this post in threaded view
|

[JIRA] (JENKINS-14102) Unstable main build leads to post steps being executed even if configured not to

JIRA noreply@jenkins-ci.org
In reply to this post by JIRA noreply@jenkins-ci.org
Peter S commented on Bug JENKINS-14102

Could you check, does <runPostStepsIfResult>success</runPostStepsIfResult> exists in job's xml config

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators.
For more information on JIRA, see: http://www.atlassian.com/software/jira
Reply | Threaded
Open this post in threaded view
|

[JIRA] (JENKINS-14102) Unstable main build leads to post steps being executed even if configured not to

JIRA noreply@jenkins-ci.org
In reply to this post by JIRA noreply@jenkins-ci.org

I got this in the end of the job config file:

<runPostStepsIfResult>
    <name>SUCCESS</name>
    <ordinal>0</ordinal>
    <color>BLUE</color>
  </runPostStepsIfResult>
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators.
For more information on JIRA, see: http://www.atlassian.com/software/jira
Reply | Threaded
Open this post in threaded view
|

[JIRA] (JENKINS-14102) Unstable main build leads to post steps being executed even if configured not to

JIRA noreply@jenkins-ci.org
In reply to this post by JIRA noreply@jenkins-ci.org
Daniel Haas commented on Bug JENKINS-14102

I have the same as Thomas

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators.
For more information on JIRA, see: http://www.atlassian.com/software/jira
Reply | Threaded
Open this post in threaded view
|

[JIRA] (JENKINS-14102) Unstable main build leads to post steps being executed even if configured not to

JIRA noreply@jenkins-ci.org
In reply to this post by JIRA noreply@jenkins-ci.org
Peter S commented on Bug JENKINS-14102

Could you place this system groovy script in postbuild steps as first step. Check console output after reproducing bug to see evaluated build result.

system groovy script
import jenkins.*;
import jenkins.model.*;

def build = Thread.currentThread().executable
println('Build result:' + build.getResult().toString())
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators.
For more information on JIRA, see: http://www.atlassian.com/software/jira
Reply | Threaded
Open this post in threaded view
|

[JIRA] (JENKINS-14102) Unstable main build leads to post steps being executed even if configured not to

JIRA noreply@jenkins-ci.org
In reply to this post by JIRA noreply@jenkins-ci.org

Here's the output:

C:\tools\jenkins\home\jobs\Test-validators\workspace>exit 0 
Build result:UNSTABLE
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators.
For more information on JIRA, see: http://www.atlassian.com/software/jira
Reply | Threaded
Open this post in threaded view
|

[JIRA] (JENKINS-14102) Unstable main build leads to post steps being executed even if configured not to

JIRA noreply@jenkins-ci.org
In reply to this post by JIRA noreply@jenkins-ci.org
 
Thomas Demande edited a comment on Bug JENKINS-14102

Here's the output:

C:\tools\jenkins\home\jobs\Test-validators\workspace>exit 0 
Build result:UNSTABLE

P.S.: Note that on that execution, post-steps were configured as "Run only if build succeeds"

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators.
For more information on JIRA, see: http://www.atlassian.com/software/jira
Reply | Threaded
Open this post in threaded view
|

[JIRA] (JENKINS-14102) Unstable main build leads to post steps being executed even if configured not to

JIRA noreply@jenkins-ci.org
In reply to this post by JIRA noreply@jenkins-ci.org

I get the same error with Jenkins 1.473, Maven build unstable but post steps still executed.
I have also tried to pass a -Dmaven.test.failure.ignore=false, the build is then failed but post steps are still executed :/

Is there any planned date/version to get a fix for this annoying problem?

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators.
For more information on JIRA, see: http://www.atlassian.com/software/jira
Reply | Threaded
Open this post in threaded view
|

[JIRA] (JENKINS-14102) Unstable main build leads to post steps being executed even if configured not to

JIRA noreply@jenkins-ci.org
In reply to this post by JIRA noreply@jenkins-ci.org
Change By: domi (17/Dec/12 4:15 PM)
Component/s: maven
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators.
For more information on JIRA, see: http://www.atlassian.com/software/jira
Reply | Threaded
Open this post in threaded view
|

[JIRA] (JENKINS-14102) Unstable main build leads to post steps being executed even if configured not to

JIRA noreply@jenkins-ci.org
In reply to this post by JIRA noreply@jenkins-ci.org
domi commented on Bug JENKINS-14102

Even though the final build state of a maven project with test failures was correct or better the icon/ball had the correct color (yellow) - the build internally did not expose the correct state to post build steps.
This causes issues with post build steps and publishers relying on the correct state of the build.

just placed a pull request to fix this issue: https://github.com/jenkinsci/jenkins/pull/654

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators.
For more information on JIRA, see: http://www.atlassian.com/software/jira
Reply | Threaded
Open this post in threaded view
|

[JIRA] (JENKINS-14102) Unstable main build leads to post steps being executed even if configured not to

JIRA noreply@jenkins-ci.org
In reply to this post by JIRA noreply@jenkins-ci.org

Code changed in jenkins
User: imod
Path:
maven-plugin/src/main/java/hudson/maven/Maven3Builder.java
maven-plugin/src/main/java/hudson/maven/MavenModuleSet.java
maven-plugin/src/main/java/hudson/maven/reporters/SurefireArchiver.java
maven-plugin/src/main/java/hudson/maven/reporters/TestFailureDetector.java
test/src/test/java/hudson/maven/MavenBuildSurefireFailedTest.java
http://jenkins-ci.org/commit/jenkins/5f4f68be0081cd9b9554c7d0ce8529c573764056
Log:
[FIXED JENKINS-14102] mark maven build with test failures as unstable

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators.
For more information on JIRA, see: http://www.atlassian.com/software/jira
Reply | Threaded
Open this post in threaded view
|

[JIRA] (JENKINS-14102) Unstable main build leads to post steps being executed even if configured not to

JIRA noreply@jenkins-ci.org
In reply to this post by JIRA noreply@jenkins-ci.org
Change By: SCM/JIRA link daemon (21/Dec/12 6:25 PM)
Status: Open Resolved
Resolution: Fixed
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators.
For more information on JIRA, see: http://www.atlassian.com/software/jira
Reply | Threaded
Open this post in threaded view
|

[JIRA] (JENKINS-14102) Unstable main build leads to post steps being executed even if configured not to

JIRA noreply@jenkins-ci.org
In reply to this post by JIRA noreply@jenkins-ci.org

Code changed in jenkins
User: imod
Path:
maven-plugin/src/main/java/hudson/maven/Maven2Builder.java
maven-plugin/src/main/java/hudson/maven/Maven3Builder.java
maven-plugin/src/main/java/hudson/maven/MavenBuild.java
maven-plugin/src/main/java/hudson/maven/MavenBuilder.java
maven-plugin/src/main/java/hudson/maven/reporters/TestFailureDetector.java
test/src/test/java/hudson/maven/MavenBuildSurefireFailedTest.java
http://jenkins-ci.org/commit/jenkins/193173f5597ca02a5ce73a2e34343f77493025dc
Log:
[FIXED JENKINS-14102] fix also for maven2 and add test cases

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators.
For more information on JIRA, see: http://www.atlassian.com/software/jira
12