diff --git a/changelog.html b/changelog.html
index 0fb0081a4c31f01bcb32e85941a52a103533aab4..9e247819879c33b6c6eaf0e024c4ecd222a355ef 100644
--- a/changelog.html
+++ b/changelog.html
@@ -83,6 +83,9 @@ Upcoming changes
Use fine-grained permissions for node manipulation via REST API & CLI
(issue 18485)
+
+ Make the link to the aggregated test result from the project page work.
+ (issue 9637)
diff --git a/core/src/main/resources/hudson/model/AbstractProject/main.jelly b/core/src/main/resources/hudson/model/AbstractProject/main.jelly
index 8f5d883e8269ccfdfcbd9c4e8c3ab32595dabd58..8400f08519c2ddf63b1a4c2f1a959008279b37da 100644
--- a/core/src/main/resources/hudson/model/AbstractProject/main.jelly
+++ b/core/src/main/resources/hudson/model/AbstractProject/main.jelly
@@ -31,7 +31,7 @@ THE SOFTWARE.
-
+
diff --git a/test/src/test/java/hudson/tasks/test/AggregatedTestResultPublisherTest.java b/test/src/test/java/hudson/tasks/test/AggregatedTestResultPublisherTest.java
index 7ef5af1f94db99fadf6346673d536040a61eeaab..1026d3a1a47c2c26e0da61f0312caf8caca01400 100644
--- a/test/src/test/java/hudson/tasks/test/AggregatedTestResultPublisherTest.java
+++ b/test/src/test/java/hudson/tasks/test/AggregatedTestResultPublisherTest.java
@@ -56,9 +56,10 @@ public class AggregatedTestResultPublisherTest {
buildAndSetupPageObjects();
projectPage.getLatestAggregatedTestReportLink()
- .assertHasLatestTestResultText()
+ .assertHasLatestAggregatedTestResultText()
.assertHasTests()
.follow().hasLinkToTestResultOfBuild(TEST_PROJECT_NAME, 1);
+
projectPage.assertNoTestReportLink();
buildPage.getAggregatedTestReportLink()
@@ -80,7 +81,10 @@ public class AggregatedTestResultPublisherTest {
.assertHasLatestTestResultText()
.assertHasTests()
.follow();
- projectPage.assertNoAggregatedTestReportLink();
+ projectPage.getLatestAggregatedTestReportLink()
+ .assertHasLatestAggregatedTestResultText()
+ .assertNoTests()
+ .follow();
buildPage.getTestReportLink()
.assertHasTestResultText()
@@ -88,7 +92,8 @@ public class AggregatedTestResultPublisherTest {
.follow();
buildPage.getAggregatedTestReportLink()
.assertHasAggregatedTestResultText()
- .assertNoTests();
+ .assertNoTests()
+ .follow();
}
@LocalData
@@ -103,7 +108,10 @@ public class AggregatedTestResultPublisherTest {
.assertHasLatestTestResultText()
.assertHasTests()
.follow();
- projectPage.assertNoAggregatedTestReportLink();
+ projectPage.getLatestAggregatedTestReportLink()
+ .assertHasLatestAggregatedTestResultText()
+ .assertHasTests()
+ .follow();
buildPage.getTestReportLink()
.assertHasTestResultText()
@@ -123,11 +131,15 @@ public class AggregatedTestResultPublisherTest {
}
private void buildOnce() throws Exception {
+ build(1);
+ }
+
+ private void build(int numberOfDownstreamBuilds) throws Exception {
build = j.buildAndAssertSuccess(upstreamProject);
j.waitUntilNoActivity();
List> downstreamBuilds = ImmutableList.copyOf(build.getDownstreamBuilds(downstreamProject));
- assertThat(downstreamBuilds, hasSize(1));
+ assertThat(downstreamBuilds, hasSize(numberOfDownstreamBuilds));
}
@@ -169,7 +181,7 @@ public class AggregatedTestResultPublisherTest {
private void addFingerprinterToProject(FreeStyleProject project, String[] contents, String[] files) throws Exception {
StringBuilder targets = new StringBuilder();
for (int i = 0; i < contents.length; i++) {
- project.getBuildersList().add(new Shell("echo " + contents[i] + " > " + files[i]));
+ project.getBuildersList().add(new Shell("echo $BUILD_NUMBER " + contents[i] + " > " + files[i]));
targets.append(files[i]).append(',');
}