Skip to content
Permalink
Browse files

[FIXED JENKINS-7970] JUnit result archiver should only fail builds if…

… there are really no results - i.e. also no skipped tests.
  • Loading branch information
kutzi committed Apr 2, 2013
1 parent 809fa1f commit 9bc7e21dc0bd679e7b6506f264079630493237d4
@@ -55,7 +55,9 @@
<!-- Record your changes in the trunk here. -->
<div id="trunk" style="display:none"><!--=TRUNK-BEGIN=-->
<ul class=image>
<li class=>
<li class=bug>
JUnit result archiver should only fail builds if there are really no results - i.e. also no skipped tests.
(<a href="https://issues.jenkins-ci.org/browse/JENKINS-7970">issue 7970</a>)
</ul>
</div><!--=TRUNK-END=-->

@@ -57,7 +57,6 @@
import org.kohsuke.stapler.StaplerRequest;

import java.io.IOException;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
@@ -139,8 +138,10 @@ public boolean perform(AbstractBuild build, Launcher launcher,
throw new AbortException(Messages.JUnitResultArchiver_BadXML(testResults));
}
result.freeze(action);
if (result.getPassCount() == 0 && result.getFailCount() == 0)
if (result.isEmpty()) {
// most likely a configuration error in the job - e.g. false pattern to match the JUnit result files
throw new AbortException(Messages.JUnitResultArchiver_ResultIsEmpty());
}

// TODO: Move into JUnitParser [BUG 3123310]
List<Data> data = new ArrayList<Data>();
@@ -377,6 +377,15 @@ public int getFailCount() {
public int getSkipCount() {
return skippedTests;
}

/**
* Returns <tt>true</tt> if this doesn't have any any test results.
* @since 1.511
*/
@Exported(visibility=999)
public boolean isEmpty() {
return getTotalCount() == 0;
}

@Override
public List<CaseResult> getFailedTests() {

0 comments on commit 9bc7e21

Please sign in to comment.
You can’t perform that action at this time.