summaryrefslogtreecommitdiffstats
path: root/controller-server
diff options
context:
space:
mode:
authorJon Marius Venstad <venstad@gmail.com>2019-11-09 08:05:53 +0100
committerJon Marius Venstad <venstad@gmail.com>2019-11-09 08:05:53 +0100
commit0c5de9e41d0aa513cf3f47041f5010473d32a5ed (patch)
tree2e2b3cf6e915f4ac47816f6f60ce778af8c770e9 /controller-server
parent972b8ae6ca99fec1f3ae87365ef6ab7f17c1d9f7 (diff)
Add a multi-instance app in deploynent api test
Diffstat (limited to 'controller-server')
-rw-r--r--controller-server/src/test/java/com/yahoo/vespa/hosted/controller/restapi/deployment/DeploymentApiTest.java13
-rw-r--r--controller-server/src/test/java/com/yahoo/vespa/hosted/controller/restapi/deployment/responses/root.json23
2 files changed, 29 insertions, 7 deletions
diff --git a/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/restapi/deployment/DeploymentApiTest.java b/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/restapi/deployment/DeploymentApiTest.java
index 3c23053eac0..b2c851a4b7d 100644
--- a/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/restapi/deployment/DeploymentApiTest.java
+++ b/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/restapi/deployment/DeploymentApiTest.java
@@ -36,17 +36,22 @@ public class DeploymentApiTest extends ControllerContainerTest {
DeploymentTester deploymentTester = new DeploymentTester(new ControllerTester(tester));
Version version = Version.fromString("5.0");
deploymentTester.controllerTester().upgradeSystem(version);
+ ApplicationPackage multiInstancePackage = new ApplicationPackageBuilder()
+ .instances("i1,i2")
+ .region("us-west-1")
+ .build();
ApplicationPackage applicationPackage = new ApplicationPackageBuilder()
- .environment(Environment.prod)
.region("us-west-1")
.build();
// 3 applications deploy on current system version
var failingApp = deploymentTester.newDeploymentContext("tenant1", "application1", "default");
- var productionApp = deploymentTester.newDeploymentContext("tenant2", "application2", "default");
+ var productionApp = deploymentTester.newDeploymentContext("tenant2", "application2", "i1");
+ var otherProductionApp = deploymentTester.newDeploymentContext("tenant2", "application2", "i2");
var appWithoutDeployments = deploymentTester.newDeploymentContext("tenant3", "application3", "default");
failingApp.submit(applicationPackage).deploy();
- productionApp.submit(applicationPackage).deploy();
+ productionApp.submit(multiInstancePackage).runJob(JobType.systemTest).runJob(JobType.stagingTest).runJob(JobType.productionUsWest1);
+ otherProductionApp.runJob(JobType.systemTest).runJob(JobType.stagingTest).runJob(JobType.productionUsWest1);
// Deploy once so that job information is stored, then remove the deployment
appWithoutDeployments.submit(applicationPackage).deploy();
@@ -59,7 +64,7 @@ public class DeploymentApiTest extends ControllerContainerTest {
// Applications upgrade, 1/2 succeed
deploymentTester.upgrader().maintain();
deploymentTester.triggerJobs();
- productionApp.deployPlatform(version);
+ productionApp.runJob(JobType.systemTest).runJob(JobType.stagingTest).runJob(JobType.productionUsWest1);
failingApp.runJob(JobType.systemTest).failDeployment(JobType.stagingTest);
deploymentTester.triggerJobs();
diff --git a/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/restapi/deployment/responses/root.json b/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/restapi/deployment/responses/root.json
index a3a763e9634..fb445ac600a 100644
--- a/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/restapi/deployment/responses/root.json
+++ b/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/restapi/deployment/responses/root.json
@@ -18,6 +18,15 @@
"upgradePolicy": "default",
"productionJobs": 1,
"productionSuccesses": 1
+ },
+ {
+ "tenant": "tenant2",
+ "application": "application2",
+ "instance": "i2",
+ "url": "http://localhost:8080/application/v4/tenant/tenant2/application/application2",
+ "upgradePolicy": "default",
+ "productionJobs": 1,
+ "productionSuccesses": 1
}
],
"deployingApplications": []
@@ -31,10 +40,10 @@
"systemVersion": true,
"configServers": [
{
- "hostname":"config1.test"
+ "hostname": "config1.test"
},
{
- "hostname":"config2.test"
+ "hostname": "config2.test"
}
],
"failingApplications": [
@@ -51,7 +60,7 @@
{
"tenant": "tenant2",
"application": "application2",
- "instance": "default",
+ "instance": "i1",
"url": "http://localhost:8080/application/v4/tenant/tenant2/application/application2",
"upgradePolicy": "default",
"productionJobs": 1,
@@ -66,6 +75,14 @@
"url": "http://localhost:8080/application/v4/tenant/tenant1/application/application1",
"upgradePolicy": "default",
"running": "staging-test"
+ },
+ {
+ "tenant": "tenant2",
+ "application": "application2",
+ "instance": "i2",
+ "url": "http://localhost:8080/application/v4/tenant/tenant2/application/application2",
+ "upgradePolicy": "default",
+ "running": "system-test"
}
]
}