summaryrefslogtreecommitdiffstats
path: root/controller-server/src/test
diff options
context:
space:
mode:
Diffstat (limited to 'controller-server/src/test')
-rw-r--r--controller-server/src/test/java/com/yahoo/vespa/hosted/controller/ControllerTest.java2
-rw-r--r--controller-server/src/test/java/com/yahoo/vespa/hosted/controller/deployment/DeploymentTriggerTest.java43
-rw-r--r--controller-server/src/test/java/com/yahoo/vespa/hosted/controller/maintenance/UpgraderTest.java3
-rw-r--r--controller-server/src/test/java/com/yahoo/vespa/hosted/controller/restapi/application/responses/application-without-change-multiple-deployments.json18
-rw-r--r--controller-server/src/test/java/com/yahoo/vespa/hosted/controller/restapi/application/responses/application.json18
-rw-r--r--controller-server/src/test/java/com/yahoo/vespa/hosted/controller/restapi/application/responses/application1-recursive.json18
6 files changed, 58 insertions, 44 deletions
diff --git a/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/ControllerTest.java b/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/ControllerTest.java
index a1fab2aefa2..9c82fa62da8 100644
--- a/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/ControllerTest.java
+++ b/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/ControllerTest.java
@@ -180,7 +180,7 @@ public class ControllerTest {
JobStatus jobStatus = applications.require(app1.id()).deploymentJobs().jobStatus().get(productionCorpUsEast1);
assertNotNull("Deployment job was not removed", jobStatus);
assertEquals(42, jobStatus.lastCompleted().get().id());
- assertEquals("Available change in staging-test", jobStatus.lastCompleted().get().reason());
+ assertEquals("New change available", jobStatus.lastCompleted().get().reason());
// prod zone removal is allowed with override
applicationPackage = new ApplicationPackageBuilder()
diff --git a/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/deployment/DeploymentTriggerTest.java b/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/deployment/DeploymentTriggerTest.java
index 084ffe7cbdc..59ba9f33c56 100644
--- a/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/deployment/DeploymentTriggerTest.java
+++ b/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/deployment/DeploymentTriggerTest.java
@@ -34,6 +34,7 @@ import static com.yahoo.vespa.hosted.controller.application.DeploymentJobs.JobTy
import static com.yahoo.vespa.hosted.controller.application.DeploymentJobs.JobType.stagingTest;
import static com.yahoo.vespa.hosted.controller.application.DeploymentJobs.JobType.systemTest;
import static java.util.Collections.singletonList;
+import static java.util.Optional.empty;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotEquals;
@@ -42,6 +43,7 @@ import static org.junit.Assert.assertTrue;
/**
* @author bratseth
* @author mpolden
+ * @author jvenstad
*/
public class DeploymentTriggerTest {
@@ -361,8 +363,8 @@ public class DeploymentTriggerTest {
tester.completeDeploymentWithError(application, applicationPackage, BuildJob.defaultBuildNumber + 1, productionUsCentral1);
// deployAndNotify doesn't actually deploy if the job fails, so we need to do that manually.
- tester.deployAndNotify(application, Optional.empty(), false, productionUsCentral1);
- tester.deploy(productionUsCentral1, application, Optional.empty(), false);
+ tester.deployAndNotify(application, empty(), false, productionUsCentral1);
+ tester.deploy(productionUsCentral1, application, empty(), false);
ApplicationVersion appVersion1 = ApplicationVersion.from(BuildJob.defaultSourceRevision, BuildJob.defaultBuildNumber + 1);
assertEquals(appVersion1, app.get().deployments().get(ZoneId.from("prod.us-central-1")).applicationVersion());
@@ -379,8 +381,14 @@ public class DeploymentTriggerTest {
Version version1 = new Version("6.2");
tester.upgradeSystem(version1);
tester.jobCompletion(productionUsCentral1).application(application).unsuccessful().submit();
- // TODO jvenstad: Fails here now, because job isn't triggered any more, as deploy target is not verified.
- tester.completeUpgrade(application, version1, applicationPackage);
+ tester.deployAndNotify(application, empty(), true, systemTest);
+ tester.deployAndNotify(application, empty(), true, stagingTest);
+ tester.deployAndNotify(application, empty(), true, productionUsCentral1);
+
+ // The last job has a different target, and the tests need to run again.
+ tester.deployAndNotify(application, empty(), true, systemTest);
+ tester.deployAndNotify(application, empty(), true, stagingTest);
+ tester.deployAndNotify(application, empty(), true, productionEuWest1);
assertEquals(appVersion1, app.get().deployments().get(ZoneId.from("prod.us-central-1")).applicationVersion());
}
@@ -438,6 +446,10 @@ public class DeploymentTriggerTest {
// Change is again strictly dominated, and us-central-1 is skipped, even though it is still failing.
tester.deployAndNotify(application, applicationPackage, false, productionUsCentral1);
+
+ // Last job has a different deployment target, so tests need to run again.
+ tester.deployAndNotify(application, empty(), true, systemTest);
+ tester.deployAndNotify(application, empty(), true, stagingTest);
tester.deployAndNotify(application, applicationPackage, true, productionEuWest1);
assertFalse(app.get().change().isPresent());
assertFalse(app.get().deploymentJobs().jobStatus().get(productionUsCentral1).isSuccess());
@@ -461,9 +473,9 @@ public class DeploymentTriggerTest {
Version v1 = new Version("6.1");
Version v2 = new Version("6.2");
tester.upgradeSystem(v2);
- tester.deployAndNotify(application, Optional.empty(), true, systemTest);
- tester.deployAndNotify(application, Optional.empty(), true, stagingTest);
- tester.deployAndNotify(application, Optional.empty(), true, productionUsCentral1);
+ tester.deployAndNotify(application, empty(), true, systemTest);
+ tester.deployAndNotify(application, empty(), true, stagingTest);
+ tester.deployAndNotify(application, empty(), true, productionUsCentral1);
tester.deploymentTrigger().cancelChange(application.id(), true);
tester.deploy(productionEuWest1, application, applicationPackage);
tester.deployAndNotify(application, applicationPackage, false, productionEuWest1);
@@ -473,22 +485,21 @@ public class DeploymentTriggerTest {
assertEquals(v1, app.get().deployments().get(productionUsEast3.zone(main).get()).version());
// New application version should run system and staging tests first against 6.2, then against 6.1.
- // TODO jvenstad: Make triggering happen at 6.2 here, since that is the first production job. Currently it tests 6.1.
tester.jobCompletion(component).application(application).nextBuildNumber().uploadArtifact(applicationPackage).submit();
assertEquals(v2, app.get().deploymentJobs().jobStatus().get(systemTest).lastTriggered().get().version());
- tester.deployAndNotify(application, Optional.empty(), true, systemTest);
+ tester.deployAndNotify(application, empty(), true, systemTest);
assertEquals(v2, app.get().deploymentJobs().jobStatus().get(stagingTest).lastTriggered().get().version());
- tester.deployAndNotify(application, Optional.empty(), true, stagingTest);
- tester.deployAndNotify(application, Optional.empty(), true, productionUsCentral1);
+ tester.deployAndNotify(application, empty(), true, stagingTest);
+ tester.deployAndNotify(application, empty(), true, productionUsCentral1);
assertEquals(v1, app.get().deploymentJobs().jobStatus().get(systemTest).lastTriggered().get().version());
- tester.deployAndNotify(application, Optional.empty(), true, systemTest);
+ tester.deployAndNotify(application, empty(), true, systemTest);
assertEquals(v1, app.get().deploymentJobs().jobStatus().get(stagingTest).lastTriggered().get().version());
- tester.deployAndNotify(application, Optional.empty(), true, stagingTest);
+ tester.deployAndNotify(application, empty(), true, stagingTest);
// The production job on version 6.2 fails and must retry -- this is OK, even though staging now has a different version.
- tester.deployAndNotify(application, Optional.empty(), false, productionEuWest1);
- tester.deployAndNotify(application, Optional.empty(), true, productionUsEast3);
- tester.deployAndNotify(application, Optional.empty(), true, productionEuWest1);
+ tester.deployAndNotify(application, empty(), false, productionEuWest1);
+ tester.deployAndNotify(application, empty(), true, productionUsEast3);
+ tester.deployAndNotify(application, empty(), true, productionEuWest1);
assertFalse(app.get().change().isPresent());
assertEquals(43, app.get().deploymentJobs().jobStatus().get(productionUsCentral1).lastSuccess().get().applicationVersion().buildNumber().get().longValue());
assertEquals(43, app.get().deploymentJobs().jobStatus().get(productionEuWest1).lastSuccess().get().applicationVersion().buildNumber().get().longValue());
diff --git a/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/maintenance/UpgraderTest.java b/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/maintenance/UpgraderTest.java
index db95a15cff4..5b1c99ec727 100644
--- a/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/maintenance/UpgraderTest.java
+++ b/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/maintenance/UpgraderTest.java
@@ -504,6 +504,9 @@ public class UpgraderTest {
tester.readyJobTrigger().maintain();
tester.readyJobTrigger().maintain();
tester.readyJobTrigger().maintain();
+ tester.readyJobTrigger().maintain();
+ tester.readyJobTrigger().maintain();
+ tester.readyJobTrigger().maintain();
// Canaries upgrade and raise confidence of V2
tester.completeUpgrade(canary0, v2, "canary");
diff --git a/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/restapi/application/responses/application-without-change-multiple-deployments.json b/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/restapi/application/responses/application-without-change-multiple-deployments.json
index e1ff2712e4a..1a88a7691f1 100644
--- a/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/restapi/application/responses/application-without-change-multiple-deployments.json
+++ b/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/restapi/application/responses/application-without-change-multiple-deployments.json
@@ -48,7 +48,7 @@
"gitCommit": "commit1"
}
},
- "reason": "Deploying application change to 1.0.101-commit1",
+ "reason": "Testing deployment for production-us-east-3",
"at": "(ignore)"
},
"lastCompleted": {
@@ -62,7 +62,7 @@
"gitCommit": "commit1"
}
},
- "reason": "Deploying application change to 1.0.101-commit1",
+ "reason": "Testing deployment for production-us-east-3",
"at": "(ignore)"
},
"lastSuccess": {
@@ -76,7 +76,7 @@
"gitCommit": "commit1"
}
},
- "reason": "Deploying application change to 1.0.101-commit1",
+ "reason": "Testing deployment for production-us-east-3",
"at": "(ignore)"
}
},
@@ -94,7 +94,7 @@
"gitCommit": "commit1"
}
},
- "reason": "Available change in system-test",
+ "reason": "Testing deployment for production-us-west-1",
"at": "(ignore)"
},
"lastCompleted": {
@@ -108,7 +108,7 @@
"gitCommit": "commit1"
}
},
- "reason": "Available change in system-test",
+ "reason": "Testing deployment for production-us-west-1",
"at": "(ignore)"
},
"lastSuccess": {
@@ -122,7 +122,7 @@
"gitCommit": "commit1"
}
},
- "reason": "Available change in system-test",
+ "reason": "Testing deployment for production-us-west-1",
"at": "(ignore)"
}
},
@@ -140,7 +140,7 @@
"gitCommit": "commit1"
}
},
- "reason": "Available change in staging-test",
+ "reason": "New change available",
"at": "(ignore)"
},
"lastCompleted": {
@@ -154,7 +154,7 @@
"gitCommit": "commit1"
}
},
- "reason": "Available change in staging-test",
+ "reason": "New change available",
"at": "(ignore)"
},
"lastSuccess": {
@@ -168,7 +168,7 @@
"gitCommit": "commit1"
}
},
- "reason": "Available change in staging-test",
+ "reason": "New change available",
"at": "(ignore)"
}
},
diff --git a/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/restapi/application/responses/application.json b/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/restapi/application/responses/application.json
index 2491aec22d1..e3d7c86c051 100644
--- a/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/restapi/application/responses/application.json
+++ b/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/restapi/application/responses/application.json
@@ -58,7 +58,7 @@
"gitCommit": "commit1"
}
},
- "reason": "Deploying application change to 1.0.42-commit1",
+ "reason": "Testing deployment for production-corp-us-east-1",
"at": "(ignore)"
},
"lastCompleted": {
@@ -72,7 +72,7 @@
"gitCommit": "commit1"
}
},
- "reason": "Deploying application change to 1.0.42-commit1",
+ "reason": "Testing deployment for production-corp-us-east-1",
"at": "(ignore)"
},
"lastSuccess": {
@@ -86,7 +86,7 @@
"gitCommit": "commit1"
}
},
- "reason": "Deploying application change to 1.0.42-commit1",
+ "reason": "Testing deployment for production-corp-us-east-1",
"at": "(ignore)"
}
},
@@ -104,7 +104,7 @@
"gitCommit": "commit1"
}
},
- "reason": "Available change in system-test",
+ "reason": "Testing deployment for production-corp-us-east-1",
"at": "(ignore)"
},
"lastCompleted": {
@@ -118,7 +118,7 @@
"gitCommit": "commit1"
}
},
- "reason": "Available change in system-test",
+ "reason": "Testing deployment for production-corp-us-east-1",
"at": "(ignore)"
},
"lastSuccess": {
@@ -132,7 +132,7 @@
"gitCommit": "commit1"
}
},
- "reason": "Available change in system-test",
+ "reason": "Testing deployment for production-corp-us-east-1",
"at": "(ignore)"
}
},
@@ -150,7 +150,7 @@
"gitCommit": "commit1"
}
},
- "reason": "Available change in staging-test",
+ "reason": "New change available",
"at": "(ignore)"
},
"lastCompleted": {
@@ -164,7 +164,7 @@
"gitCommit": "commit1"
}
},
- "reason": "Available change in staging-test",
+ "reason": "New change available",
"at": "(ignore)"
},
"firstFailing": {
@@ -178,7 +178,7 @@
"gitCommit": "commit1"
}
},
- "reason": "Available change in staging-test",
+ "reason": "New change available",
"at": "(ignore)"
}
}
diff --git a/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/restapi/application/responses/application1-recursive.json b/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/restapi/application/responses/application1-recursive.json
index 8598ff37333..4bc7511c695 100644
--- a/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/restapi/application/responses/application1-recursive.json
+++ b/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/restapi/application/responses/application1-recursive.json
@@ -58,7 +58,7 @@
"gitCommit": "commit1"
}
},
- "reason": "Deploying application change to 1.0.42-commit1",
+ "reason": "Testing deployment for production-corp-us-east-1",
"at": "(ignore)"
},
"lastCompleted": {
@@ -72,7 +72,7 @@
"gitCommit": "commit1"
}
},
- "reason": "Deploying application change to 1.0.42-commit1",
+ "reason": "Testing deployment for production-corp-us-east-1",
"at": "(ignore)"
},
"lastSuccess": {
@@ -86,7 +86,7 @@
"gitCommit": "commit1"
}
},
- "reason": "Deploying application change to 1.0.42-commit1",
+ "reason": "Testing deployment for production-corp-us-east-1",
"at": "(ignore)"
}
},
@@ -104,7 +104,7 @@
"gitCommit": "commit1"
}
},
- "reason": "Available change in system-test",
+ "reason": "Testing deployment for production-corp-us-east-1",
"at": "(ignore)"
},
"lastCompleted": {
@@ -118,7 +118,7 @@
"gitCommit": "commit1"
}
},
- "reason": "Available change in system-test",
+ "reason": "Testing deployment for production-corp-us-east-1",
"at": "(ignore)"
},
"lastSuccess": {
@@ -132,7 +132,7 @@
"gitCommit": "commit1"
}
},
- "reason": "Available change in system-test",
+ "reason": "Testing deployment for production-corp-us-east-1",
"at": "(ignore)"
}
},
@@ -150,7 +150,7 @@
"gitCommit": "commit1"
}
},
- "reason": "Available change in staging-test",
+ "reason": "New change available",
"at": "(ignore)"
},
"lastCompleted": {
@@ -164,7 +164,7 @@
"gitCommit": "commit1"
}
},
- "reason": "Available change in staging-test",
+ "reason": "New change available",
"at": "(ignore)"
},
"firstFailing": {
@@ -178,7 +178,7 @@
"gitCommit": "commit1"
}
},
- "reason": "Available change in staging-test",
+ "reason": "New change available",
"at": "(ignore)"
}
}