Issue Type: Bug Bug
Assignee: dlindner
Components: crap4j
Created: 29/Sep/14 12:47 PM
Description:

For more details see this thread:
https://issues.jenkins-ci.org/browse/JENKINS-24833

When Crap4J has a failure and can't find the report files, it returns false instead of setting build status to build.FAILURE. This results in Jenkins eventually recognizing a failed build, but allows all other post build steps to run including steps that are only supposed to run with a successful build. I think this should be a one line fix to add:
build.setResult(Result.FAILURE);
and then return true instead of false.

Crap4J returns false on failure https://svn.jenkins-ci.org/trunk/hudson/plugins/crap4j/src/main/java/hudson/plugins/crap4j/Crap4JPublisher.java
if (0 == reports.length) { log(logger, "No crap4j report files were found. Configuration error?"); return false; }

Where xUnit returns true and sets the build result to failure
https://github.com/jenkinsci/xunit-plugin/blob/a0ad57db81ef5a91162dbfa7190a1a8bcb838edd/src/main/java/org/jenkinsci/plugins/xunit/XUnitProcessor.java#L83

GitPublisher is looking at the build result to determine a successful result or not:
https://github.com/jenkinsci/git-plugin/blob/cebb9da131fa6c9e07ec9e6ff71ec89aa58fdd6f/src/main/java/hudson/plugins/git/GitPublisher.java#L203

Theoretically the false result is canContinue:
https://github.com/jenkinsci/jenkins/blob/a197999c6c57ad761f7242b9f6b28c0333175601/core/src/main/java/hudson/model/AbstractBuild.java#L781

But in actuality all build steps run even if one fails (though a final result of false is reported):
https://github.com/jenkinsci/jenkins/blob/a197999c6c57ad761f7242b9f6b28c0333175601/core/src/main/java/hudson/model/AbstractBuild.java#L724

It looks like their is absolutely no way that git-publish could know that Crap4J failed unless Crap4J changes the build result when it has a failure.

Environment: System Properties
Name ↓ Value
executable-war /usr/share/jenkins/jenkins.war
file.encoding UTF-8
file.encoding.pkg sun.io
file.separator /
hudson.diyChunking true
java.awt.graphicsenv sun.awt.X11GraphicsEnvironment
java.awt.headless true
java.awt.printerjob sun.print.PSPrinterJob
java.class.path /usr/share/jenkins/jenkins.war
java.class.version 50.0
java.endorsed.dirs /usr/lib/jvm/java-6-openjdk-amd64/jre/lib/endorsed
java.ext.dirs /usr/lib/jvm/java-6-openjdk-amd64/jre/lib/ext:/usr/java/packages/lib/ext
java.home /usr/lib/jvm/java-6-openjdk-amd64/jre
java.io.tmpdir /tmp
java.library.path /usr/lib/jvm/java-6-openjdk-amd64/jre/lib/amd64/server:/usr/lib/jvm/java-6-openjdk-amd64/jre/lib/amd64:/usr/lib/jvm/java-6-openjdk-amd64/jre/../lib/amd64:/usr/java/packages/lib/amd64:/usr/lib/x86_64-linux-gnu/jni:/lib/x86_64-linux-gnu:/usr/lib/x86_64-linux-gnu:/usr/lib/jni:/lib:/usr/lib
java.runtime.name OpenJDK Runtime Environment
java.runtime.version 1.6.0_32-b32
java.specification.name Java Platform API Specification
java.specification.vendor Sun Microsystems Inc.
java.specification.version 1.6
java.vendor Sun Microsystems Inc.
java.vendor.url http://java.sun.com/
java.vendor.url.bug http://java.sun.com/cgi-bin/bugreport.cgi
java.version 1.6.0_32
java.vm.info mixed mode
java.vm.name OpenJDK 64-Bit Server VM
java.vm.specification.name Java Virtual Machine Specification
java.vm.specification.vendor Sun Microsystems Inc.
java.vm.specification.version 1.0
java.vm.vendor Sun Microsystems Inc.
java.vm.version 23.25-b01
jna.platform.library.path /usr/lib/x86_64-linux-gnu:/lib/x86_64-linux-gnu:/lib64:/usr/lib:/lib
line.separator
mail.smtp.sendpartial true
mail.smtps.sendpartial true
os.arch amd64
os.name Linux
os.version 3.2.0-60-generic
path.separator :
sun.arch.data.model 64
sun.boot.class.path /usr/lib/jvm/java-6-openjdk-amd64/jre/lib/resources.jar:/usr/lib/jvm/java-6-openjdk-amd64/jre/lib/rt.jar:/usr/lib/jvm/java-6-openjdk-amd64/jre/lib/sunrsasign.jar:/usr/lib/jvm/java-6-openjdk-amd64/jre/lib/jsse.jar:/usr/lib/jvm/java-6-openjdk-amd64/jre/lib/jce.jar:/usr/lib/jvm/java-6-openjdk-amd64/jre/lib/charsets.jar:/usr/lib/jvm/java-6-openjdk-amd64/jre/lib/jfr.jar:/usr/lib/jvm/java-6-openjdk-amd64/jre/lib/netx.jar:/usr/lib/jvm/java-6-openjdk-amd64/jre/lib/plugin.jar:/usr/lib/jvm/java-6-openjdk-amd64/jre/lib/rhino.jar:/usr/lib/jvm/java-6-openjdk-amd64/jre/classes
sun.boot.library.path /usr/lib/jvm/java-6-openjdk-amd64/jre/lib/amd64
sun.cpu.endian little
sun.cpu.isalist
sun.io.unicode.encoding UnicodeLittle
sun.java.command /usr/share/jenkins/jenkins.war --webroot=/var/cache/jenkins/war --httpPort=8080 --prefix=/jenkins --httpListenAddress=127.0.0.1 --ajp13Port=-1
sun.java.launcher SUN_STANDARD
sun.jnu.encoding UTF-8
sun.management.compiler HotSpot 64-Bit Tiered Compilers
sun.os.patch.level unknown
svnkit.http.methods Digest,Basic,NTLM,Negotiate
svnkit.ssh2.persistent false
user.country US
user.dir /
user.home /var/lib/jenkins
user.language en
user.name jenkins
user.timezone America/New_York
Environment Variables
Name ↓ Value
_ /usr/bin/daemon
_system_arch x86_64
_system_name Ubuntu
_system_type Linux
_system_version 12.04
GEM_HOME /usr/local/rvm/gems/ruby-2.0.0-p451
GEM_PATH /usr/local/rvm/gems/ruby-2.0.0-p451:/usr/local/rvm/gems/ruby-2.0.0-p451@global
HOME /var/lib/jenkins
IRBRC /usr/local/rvm/rubies/ruby-2.0.0-p451/.irbrc
JENKINS_HOME /var/lib/jenkins
LANG en_US.UTF-8
LD_LIBRARY_PATH /usr/lib/jvm/java-6-openjdk-amd64/jre/lib/amd64/server:/usr/lib/jvm/java-6-openjdk-amd64/jre/lib/amd64:/usr/lib/jvm/java-6-openjdk-amd64/jre/../lib/amd64
LOGNAME jenkins
MAIL /var/mail/jenkins
MY_RUBY_HOME /usr/local/rvm/rubies/ruby-2.0.0-p451
PATH /usr/local/rvm/gems/ruby-2.0.0-p451/bin:/usr/local/rvm/gems/ruby-2.0.0-p451@global/bin:/usr/local/rvm/rubies/ruby-2.0.0-p451/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games:/usr/local/rvm/bin
PWD /var/lib/jenkins
rvm_bin_path /usr/local/rvm/bin
rvm_path /usr/local/rvm
rvm_prefix /usr/local
rvm_version 1.25.19 (stable)
SHELL /bin/bash
SHLVL 1
TERM xterm-256color
USER jenkins
XDG_SESSION_COOKIE 19e50fba4d08d2c6df7d9f2d0000020a-1411395001.583446-128541024
Plugins
Name ↓ Version Enabled Pinned
analysis-core 1.59 true false
ant 1.2 true false
antisamy-markup-formatter 1.2 true true
build-pipeline-plugin 1.4.3 true false
checkstyle 3.39 true false
cloverphp 0.3.3 true false
crap4j 0.8 true false
credentials 1.16.1 true true
cvs 2.12 true true
dry 2.40 true false
email-ext 2.38.2 true false
external-monitor-job 1.2 true false
git 2.2.6 true false
git-client 1.10.2 true false
htmlpublisher 1.3 true false
javadoc 1.2 true true
jdepend 1.2.3 true false
jquery 1.7.2-1 true false
junit 1.1 true true
ldap 1.10.2 true true
mailer 1.11 true true
mapdb-api 1.0.1.0 true false
matrix-auth 1.2 true true
matrix-project 1.3 true true
maven-plugin 2.6 true true
pam-auth 1.2 true true
parameterized-trigger 2.25 true false
plot 1.7 true false
pmd 3.38 true false
postbuild-task 1.8 true false
scm-api 0.2 true false
ssh-credentials 1.9 true true
ssh-slaves 1.6 true true
subversion 2.4.3 true true
token-macro 1.10 true false
translation 1.11 true true
violations 0.7.11 true false
windows-slaves 1.0 true false
xunit 1.91 true false
Thread Dumps

Visit this page for master and slave thread dumps.
Project: Jenkins
Priority: Minor Minor
Reporter: Loren Klingman
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

--
You received this message because you are subscribed to the Google Groups "Jenkins Issues" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to