diff options
author | Jon Marius Venstad <jvenstad@yahoo-inc.com> | 2018-01-23 16:30:37 +0100 |
---|---|---|
committer | Jon Marius Venstad <jvenstad@yahoo-inc.com> | 2018-01-23 16:30:37 +0100 |
commit | 8c8fbf37c2de5f37d256fd5ae4ccedf8bd493a84 (patch) | |
tree | 4c4071ae1acb796101071496707b2cb987d1f396 /controller-server | |
parent | aaeb478ae524242dd2b8895583da7ed43dc32357 (diff) |
Update filter too, and add test
Diffstat (limited to 'controller-server')
2 files changed, 7 insertions, 4 deletions
diff --git a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/application/ApplicationList.java b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/application/ApplicationList.java index 07d51b2b9c7..283d6a75178 100644 --- a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/application/ApplicationList.java +++ b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/application/ApplicationList.java @@ -145,10 +145,10 @@ public class ApplicationList { /** * Returns the subset of applications which are not pull requests: - * Pull requests changes the application instance name to default-pr[pull-request-number] + * Pull requests changes the application instance name to (default-pr)?[pull-request-number] */ public ApplicationList notPullRequest() { - return listOf(list.stream().filter(a -> ! a.id().instance().value().startsWith("default-pr"))); + return listOf(list.stream().filter(a -> ! a.id().instance().value().matches("^(default-pr)?\\d+$"))); } /** Returns the subset of applications which have at least one production deployment */ diff --git a/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/versions/VersionStatusTest.java b/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/versions/VersionStatusTest.java index 1c1e2df2c94..7745cae1cb9 100644 --- a/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/versions/VersionStatusTest.java +++ b/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/versions/VersionStatusTest.java @@ -139,10 +139,13 @@ public class VersionStatusTest { // Application without deployment Application ignored0 = tester.createApplication("ignored0", "tenant1", 1000, 1000L); - // Pull request build - Application ignored1 = tester.controllerTester().createApplication(new TenantId("tenant1"), + // Pull request builds + tester.controllerTester().createApplication(new TenantId("tenant1"), "ignored1", "default-pr42", 1000); + tester.controllerTester().createApplication(new TenantId("tenant1"), + "ignored1", + "43", 1000); assertEquals("All applications running on this version: High", Confidence.high, confidence(tester.controller(), version0)); |