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)

(cherry picked from commit bfaab51)

Conflicts:
	changelog.html
  • Loading branch information
jglick authored and olivergondza committed Jan 5, 2014
1 parent b53770c commit b5ec39f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
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 @@ -155,7 +155,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 b5ec39f

Please sign in to comment.