diff options
Diffstat (limited to 'controller-server/src/test/java/com/yahoo')
2 files changed, 21 insertions, 10 deletions
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 59ba9f33c56..fc4b8cb9621 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 @@ -120,7 +120,6 @@ public class DeploymentTriggerTest { ApplicationPackage applicationPackage = new ApplicationPackageBuilder() .environment(Environment.prod) - .delay(Duration.ofSeconds(30)) .region("us-west-1") .delay(Duration.ofMinutes(2)) .delay(Duration.ofMinutes(2)) // Multiple delays are summed up @@ -133,14 +132,8 @@ public class DeploymentTriggerTest { // Test jobs pass tester.deployAndNotify(application, applicationPackage, true, JobType.systemTest); - tester.clock().advance(Duration.ofSeconds(1)); // Make staging test sort as the last successful job tester.deployAndNotify(application, applicationPackage, true, JobType.stagingTest); - assertTrue("No more jobs triggered at this time", mockBuildService.jobs().isEmpty()); - - // 30 seconds pass, us-west-1 is triggered - tester.clock().advance(Duration.ofSeconds(30)); tester.deploymentTrigger().triggerReadyJobs(); - assertEquals(1, mockBuildService.jobs().size()); tester.assertRunning(application.id(), productionUsWest1); @@ -383,11 +376,15 @@ public class DeploymentTriggerTest { tester.jobCompletion(productionUsCentral1).application(application).unsuccessful().submit(); tester.deployAndNotify(application, empty(), true, systemTest); tester.deployAndNotify(application, empty(), true, stagingTest); - tester.deployAndNotify(application, empty(), true, productionUsCentral1); + tester.deployAndNotify(application, empty(), false, productionUsCentral1); // The last job has a different target, and the tests need to run again. + // These may now start, since the first job has been triggered once, and thus is verified already. tester.deployAndNotify(application, empty(), true, systemTest); tester.deployAndNotify(application, empty(), true, stagingTest); + + // Finally, the two production jobs complete, in order. + tester.deployAndNotify(application, empty(), true, productionUsCentral1); tester.deployAndNotify(application, empty(), true, productionEuWest1); assertEquals(appVersion1, app.get().deployments().get(ZoneId.from("prod.us-central-1")).applicationVersion()); } diff --git a/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/restapi/screwdriver/ScrewdriverApiTest.java b/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/restapi/screwdriver/ScrewdriverApiTest.java index 91d5d687531..a0cbf39e5ab 100644 --- a/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/restapi/screwdriver/ScrewdriverApiTest.java +++ b/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/restapi/screwdriver/ScrewdriverApiTest.java @@ -13,6 +13,7 @@ import org.junit.Test; import java.io.File; import java.nio.charset.StandardCharsets; +import java.util.Optional; import java.util.OptionalLong; /** @@ -67,12 +68,25 @@ public class ScrewdriverApiTest extends ControllerContainerTest { Optional.of(new SourceRevision("repo", "branch", "commit")), Optional.empty())); - // Triggers specific job when given -- fails here because the job has never run before, and so application version can't be resolved. + // Triggers specific job when given -- triggers the prerequisites here, since they are not yet fulfilled. + assertResponse(new Request("http://localhost:8080/screwdriver/v1/trigger/tenant/" + + app.id().tenant().value() + "/application/" + app.id().application().value(), + "staging-test".getBytes(StandardCharsets.UTF_8), Request.Method.POST), + 200, "{\"message\":\"Triggered system-test for tenant1.application1\"}"); + + tester.controller().applications().deploymentTrigger().notifyOfCompletion(new JobReport(app.id(), + DeploymentJobs.JobType.systemTest, + 1, + 42, + Optional.empty(), + Optional.empty())); + + // Triggers specific job when given, and when it is verified. assertResponse(new Request("http://localhost:8080/screwdriver/v1/trigger/tenant/" + app.id().tenant().value() + "/application/" + app.id().application().value(), "staging-test".getBytes(StandardCharsets.UTF_8), Request.Method.POST), 200, "{\"message\":\"Triggered staging-test for tenant1.application1\"}"); - // TODO jvenstad: This should trigger system-test instead, unless they are allowed to run in parallel. + } } |