From f4ba2204def1f4112befb9ce0e25ccf7591261f9 Mon Sep 17 00:00:00 2001 From: Jon Marius Venstad Date: Mon, 11 Nov 2019 08:10:31 +0100 Subject: Revert "Revert "Add a multi-instance app in deploynent api test"" This reverts commit 24363f1f316ae126792ccec3f6e8e88f976c663f. --- .../restapi/deployment/DeploymentApiTest.java | 13 ++++++++---- .../restapi/deployment/responses/root.json | 23 +++++++++++++++++++--- 2 files changed, 29 insertions(+), 7 deletions(-) (limited to 'controller-server') 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" } ] } -- cgit v1.2.3