@Test public void testTriggerFailing() { ApplicationPackage applicationPackage = new ApplicationPackageBuilder() .upgradePolicy("default") .environment(Environment.prod) .region("us-west-1") .build(); var app = tester.newDeploymentContext().submit(applicationPackage).deploy(); Version version = Version.fromString("6.3"); tester.controllerTester().upgradeSystem(version); tester.upgrader().maintain(); app.failDeployment(stagingTest); tester.triggerJobs(); assertEquals("Retried dead job", 2, tester.jobs().active().size()); app.assertRunning(stagingTest); app.runJob(stagingTest); app.assertRunning(systemTest); assertEquals(1, tester.jobs().active().size()); app.timeOutUpgrade(systemTest); tester.triggerJobs(); assertEquals("Job is retried on failure", 1, tester.jobs().active().size()); app.runJob(systemTest); tester.triggerJobs(); app.assertRunning(productionUsWest1); tester.applications().lockApplicationOrThrow(app.application().id(), locked -> tester.applications().store(locked.withProjectId(OptionalLong.empty()))); app.timeOutConvergence(productionUsWest1); tester.triggerJobs(); assertEquals("Job is not triggered when no projectId is present", 0, tester.jobs().active().size()); }
private ApplicationController applications() { return controller.applications(); }
DeploymentTrigger { private ApplicationController applications() { return controller.applications(); } }
DeploymentTrigger { private ApplicationController applications() { return controller.applications(); } DeploymentTrigger(Controller controller, Clock clock); }
DeploymentTrigger { private ApplicationController applications() { return controller.applications(); } DeploymentTrigger(Controller controller, Clock clock); DeploymentSteps steps(DeploymentInstanceSpec spec); void notifyOfSubmission(TenantAndApplicationId id, ApplicationVersion version, long projectId); void triggerNewRevision(TenantAndApplicationId id); void notifyOfCompletion(ApplicationId id); long triggerReadyJobs(); void trigger(Job job); JobId reTrigger(ApplicationId applicationId, JobType jobType); List<JobId> forceTrigger(ApplicationId applicationId, JobType jobType, String user, boolean requireTests); void pauseJob(ApplicationId id, JobType jobType, Instant until); void resumeJob(ApplicationId id, JobType jobType); void triggerChange(ApplicationId instanceId, Change change); void forceChange(ApplicationId instanceId, Change change); void cancelChange(ApplicationId instanceId, ChangesToCancel cancellation); boolean triggerAt(Instant instant, JobType job, JobStatus jobStatus, Versions versions, Instance instance, DeploymentSpec deploymentSpec); boolean isComplete(Change change, Change fullChange, Instance instance, JobType jobType,
                              JobStatus status); }
DeploymentTrigger { private ApplicationController applications() { return controller.applications(); } DeploymentTrigger(Controller controller, Clock clock); DeploymentSteps steps(DeploymentInstanceSpec spec); void notifyOfSubmission(TenantAndApplicationId id, ApplicationVersion version, long projectId); void triggerNewRevision(TenantAndApplicationId id); void notifyOfCompletion(ApplicationId id); long triggerReadyJobs(); void trigger(Job job); JobId reTrigger(ApplicationId applicationId, JobType jobType); List<JobId> forceTrigger(ApplicationId applicationId, JobType jobType, String user, boolean requireTests); void pauseJob(ApplicationId id, JobType jobType, Instant until); void resumeJob(ApplicationId id, JobType jobType); void triggerChange(ApplicationId instanceId, Change change); void forceChange(ApplicationId instanceId, Change change); void cancelChange(ApplicationId instanceId, ChangesToCancel cancellation); boolean triggerAt(Instant instant, JobType job, JobStatus jobStatus, Versions versions, Instance instance, DeploymentSpec deploymentSpec); boolean isComplete(Change change, Change fullChange, Instance instance, JobType jobType,
                              JobStatus status); static final Duration maxPause; }