Skip to content
Permalink
Browse files
[JENKINS-18410] NPE from previous fix (fcdf749) under some conditions…
…, 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 b5ec39f0734d05f1de05406a2dddc0bed4440d60
@@ -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;
}

@@ -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;
@@ -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();
}

0 comments on commit b5ec39f

Please sign in to comment.