提交 bfaab511 编写于 作者: J Jesse Glick

[JENKINS-18410] NPE from previous fix (fcdf7499) under some conditions, which...

[JENKINS-18410] NPE from previous fix (fcdf7499) 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)
上级 36346813
......@@ -55,7 +55,9 @@ Upcoming changes</a>
<!-- 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=-->
......
......@@ -87,7 +87,7 @@ public class AggregatedTestResultPublisher extends Recorder {
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 class AggregatedTestResultPublisher extends Recorder {
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;
......
......@@ -167,7 +167,7 @@ public class AggregatedTestResultPublisherTest {
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();
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册