summaryrefslogtreecommitdiffstats
path: root/controller-server
diff options
context:
space:
mode:
authorJon Marius Venstad <venstad@gmail.com>2019-11-11 08:10:31 +0100
committerJon Marius Venstad <venstad@gmail.com>2019-11-11 08:10:31 +0100
commitf4ba2204def1f4112befb9ce0e25ccf7591261f9 (patch)
tree80a2f11e69a20169381a195547cc4865ce6ca0af /controller-server
parent4faca41f28583c4fd6d8d27e8cc22f0d5071bd35 (diff)
Revert "Revert "Add a multi-instance app in deploynent api test""
This reverts commit 24363f1f316ae126792ccec3f6e8e88f976c663f.
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"
}
]
}