Community
Participate
Working Groups
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
Created attachment 247314 [details] Sceenshot of Config
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
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.
(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.
This is the email plugin I'm using https://wiki.jenkins-ci.org/display/JENKINS/Email-ext+plugin