Skip to content

Commit

Permalink
[JENKINS-18410] NPE from previous fix (fcdf749) under some conditions…
Browse files Browse the repository at this point in the history
…, which the test case was not exercising.

java.lang.NullPointerException
	at hudson.tasks.test.AggregatedTestResultPublisher$TestResultAction.getProject(AggregatedTestResultPublisher.java:173)
	at hudson.tasks.test.AggregatedTestResultPublisher$TestResultAction.<init>(AggregatedTestResultPublisher.java:146)
	at hudson.tasks.test.AggregatedTestResultPublisher$TestResultAction.<init>(AggregatedTestResultPublisher.java:135)
	at hudson.tasks.test.AggregatedTestResultPublisher.perform(AggregatedTestResultPublisher.java:90)
  • Loading branch information
jglick committed Jan 2, 2014
1 parent 3634681 commit bfaab51
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 8 deletions.
4 changes: 3 additions & 1 deletion changelog.html
Expand Up @@ -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="major bug">
NPE since 1.545 when using aggregated test result publisher without specifying downstream jobs explicitly.
(<a href="https://issues.jenkins-ci.org/browse/JENKINS-18410">issue 18410</a>)
</ul>
</div><!--=TRUNK-END=-->

Expand Down
Expand Up @@ -87,7 +87,7 @@ public AggregatedTestResultPublisher(String jobs, boolean includeFailedBuilds) {

public boolean perform(AbstractBuild<?,?> build, Launcher launcher, BuildListener listener) throws InterruptedException, IOException {
// add a TestResult just so that it can show up later.
build.addAction(new TestResultAction(jobs, includeFailedBuilds));
build.addAction(new TestResultAction(jobs, includeFailedBuilds, build));
return true;
}

Expand Down Expand Up @@ -131,11 +131,7 @@ public static final class TestResultAction extends AbstractTestResultAction {
private transient List<AbstractProject> didntRun;
private transient List<AbstractProject> noFingerprints;

public TestResultAction(String jobs, boolean includeFailedBuilds) {
this(jobs, includeFailedBuilds, null);
}

@Deprecated
@SuppressWarnings("deprecation") // calls getProject in constructor, so needs owner immediately
public TestResultAction(String jobs, boolean includeFailedBuilds, AbstractBuild<?,?> owner) {
super(owner);
this.includeFailedBuilds = includeFailedBuilds;
Expand Down
Expand Up @@ -167,7 +167,7 @@ private void createDownstreamProjectWithNoTests() throws Exception {
addFingerprinterToProject(downstreamProject, singleContents, singleFiles);

upstreamProject.getPublishersList().add(new BuildTrigger(ImmutableList.of(downstreamProject), Result.SUCCESS));
upstreamProject.getPublishersList().add(new AggregatedTestResultPublisher(TEST_PROJECT_NAME));
upstreamProject.getPublishersList().add(new AggregatedTestResultPublisher(null));

j.jenkins.rebuildDependencyGraph();
}
Expand Down

0 comments on commit bfaab51

Please sign in to comment.