Bug 444874 - Post build task running even though build failed
Summary: Post build task running even though build failed
Status: NEW
Alias: None
Product: Hudson
Classification: Technology
Component: Plugins (show other bugs)
Version: unspecified   Edit
Hardware: PC Unix All
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Winston Prakash CLA
QA Contact: Geoff Waymark CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-09-23 16:35 EDT by Loren Klingman CLA
Modified: 2014-09-24 14:57 EDT (History)
4 users (show)

See Also:


Attachments
Sceenshot of Config (47.56 KB, image/png)
2014-09-23 16:35 EDT, Loren Klingman CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Loren Klingman CLA 2014-09-23 16:35:03 EDT
I'm using the Post Build Task Plugin with the run only if all previous steps passed box checked, but the task is getting run even though a part failed.

Here is the output:
CRAP4J fails, but post build task runs.  I'm attaching a screenshot of the configuration.


build:

BUILD SUCCESSFUL
Total time: 1 minute 23 seconds
[CHECKSTYLE] Collecting checkstyle analysis files...
[CHECKSTYLE] Finding all files that match the pattern build/logs/checkstyle.xml
[CHECKSTYLE] Parsing 1 files in /var/lib/jenkins/workspace/SBTS Portal
[CHECKSTYLE] Successfully parsed file /var/lib/jenkins/workspace/SBTS Portal/build/logs/checkstyle.xml of module  with 253 warnings.
[CHECKSTYLE] Computing warning deltas based on reference build #108
[PMD] Collecting PMD analysis files...
[PMD] Finding all files that match the pattern build/logs/pmd.xml
[PMD] Parsing 1 files in /var/lib/jenkins/workspace/SBTS Portal
[PMD] Successfully parsed file /var/lib/jenkins/workspace/SBTS Portal/build/logs/pmd.xml of module  with 8 warnings.
[PMD] Computing warning deltas based on reference build #108
[DRY] Collecting duplicate code analysis files...
[DRY] Finding all files that match the pattern build/logs/pmd-cpd.xml
[DRY] Parsing 1 files in /var/lib/jenkins/workspace/SBTS Portal
[DRY] Successfully parsed file /var/lib/jenkins/workspace/SBTS Portal/build/logs/pmd-cpd.xml of module  with 36 warnings.
[DRY] Computing warning deltas based on reference build #108
Recording plot data
Publishing Clover coverage report...
Clover xml file does not exist in: /var/lib/jenkins/workspace/SBTS Portal called: build/logs/clover.xml and will not be copied to: /var/lib/jenkins/jobs/SBTS Portal/builds/2014-09-23_15-43-35/cloverphp/clover.xml
Could not find 'build/coverage/build/logs/clover.xml'.  Did you generate the XML report for Clover?
[CRAP4J] Collecting Crap4J analysis files...
[CRAP4J] Searching for report files within build/logs/crap4j.xml
[CRAP4J] Using the new FileSetBuilder
[CRAP4J] No crap4j report files were found. Configuration error?
Build step 'Report Crap' marked build as failure
[htmlpublisher] Archiving HTML reports...
[htmlpublisher] Archiving at BUILD level /var/lib/jenkins/workspace/SBTS Portal/build/api to /var/lib/jenkins/jobs/SBTS Portal/builds/2014-09-23_15-43-35/htmlreports/API_Documentation
[htmlpublisher] Archiving at BUILD level /var/lib/jenkins/workspace/SBTS Portal/build/phpdoc to /var/lib/jenkins/jobs/SBTS Portal/builds/2014-09-23_15-43-35/htmlreports/PHPDoc_Documentation
[xUnit] [INFO] - Starting to record.
[xUnit] [INFO] - Processing PHPUnit-3.x (default)
[xUnit] [INFO] - [PHPUnit-3.x (default)] - 1 test report file(s) were found with the pattern 'build/logs/junit.xml' relative to '/var/lib/jenkins/workspace/SBTS Portal' for the testing framework 'PHPUnit-3.x (default)'.
[xUnit] [INFO] - Converting '/var/lib/jenkins/workspace/SBTS Portal/build/logs/junit.xml' .
[xUnit] [INFO] - Check 'Failed Tests' threshold.
[xUnit] [INFO] - Check 'Skipped Tests' threshold.
[xUnit] [INFO] - Setting the build status to SUCCESS
[xUnit] [INFO] - Stopping recording.
[JDepend] JDepend plugin is ready
[JDepend] Found 273 classes in 21 packages
Performing Post build task...
Match found for : : True
Logical operation result is TRUE
Running script  : git add --all ./build/api
git commit -m "Jenkins Updating Doc Files"
[SBTS Portal] $ /bin/sh -xe /tmp/hudson3629220943294003302.sh
+ git add --all ./build/api
+ git commit -m Jenkins Updating Doc Files
[detached HEAD 42c8f11] Jenkins Updating Doc Files
 1 file changed, 1 insertion(+), 1 deletion(-)
POST BUILD TASK : SUCCESS
END OF POST BUILD TASK : 0
 > git tag -l jenkins-SBTS_Portal-111 # timeout=10
 > git tag -a -f -m Jenkins Build #111 jenkins-SBTS_Portal-111-SUCCESS # timeout=10
Pushing HEAD to branch develop of origin repository
 > git push --- HEAD:develop
Checking for post-build
Performing post-build step
Checking if email needs to be generated
Email was triggered for: Failure - Any
Sending email for trigger: Failure - Any
NOT overriding default server settings, using Mailer to create session
messageContentType = text/plain; charset=UTF-8
Adding recipients from project recipient list

Successfully created MimeMessage
Sending email to: ----
Finished: FAILURE
Comment 1 Loren Klingman CLA 2014-09-23 16:35:31 EDT
Created attachment 247314 [details]
Sceenshot of Config
Comment 2 Winston Prakash CLA 2014-09-24 12:37:10 EDT
Just before the post build action starts, I see in the log

[xUnit] [INFO] - Setting the build status to SUCCESS

This could be the reason
Comment 3 Loren Klingman CLA 2014-09-24 12:51:20 EDT
Could be, I wondered about that, but at the very button of the report, the final build status is failure and the email plugin detects the build as a failure so in the end the status is a failure.  Thus, I was wondering if this plugin might be looking at the status of just the previous plugin rather than the overall build status which the email plugin must be seeing.
Comment 4 Winston Prakash CLA 2014-09-24 13:04:05 EDT
(In reply to Loren Klingman from comment #3)
I need to look at the plugin source and see what is going on. In theory, there is one "Build Status", so this is kind of puzzling.
Comment 5 Loren Klingman CLA 2014-09-24 14:57:16 EDT
This is the email plugin I'm using
https://wiki.jenkins-ci.org/display/JENKINS/Email-ext+plugin