use of com.spotify.helios.common.descriptors.RolloutTask in project helios by spotify.
the class RollingUpdatePlannerTest method testOverlapRollout.
@Test
public void testOverlapRollout() {
final DeploymentGroup deploymentGroup = DeploymentGroup.newBuilder().setRolloutOptions(RolloutOptions.newBuilder().setOverlap(true).build()).build();
final RolloutPlanner rolloutPlanner = RollingUpdatePlanner.of(deploymentGroup);
final List<RolloutTask> tasks = rolloutPlanner.plan(HOSTS);
final List<RolloutTask> expected = Lists.newArrayList(RolloutTask.of(RolloutTask.Action.DEPLOY_NEW_JOB, "agent1"), RolloutTask.of(RolloutTask.Action.AWAIT_RUNNING, "agent1"), RolloutTask.of(RolloutTask.Action.UNDEPLOY_OLD_JOBS, "agent1"), RolloutTask.of(RolloutTask.Action.DEPLOY_NEW_JOB, "agent2"), RolloutTask.of(RolloutTask.Action.AWAIT_RUNNING, "agent2"), RolloutTask.of(RolloutTask.Action.UNDEPLOY_OLD_JOBS, "agent2"), RolloutTask.of(RolloutTask.Action.DEPLOY_NEW_JOB, "agent3"), RolloutTask.of(RolloutTask.Action.AWAIT_RUNNING, "agent3"), RolloutTask.of(RolloutTask.Action.UNDEPLOY_OLD_JOBS, "agent3"), RolloutTask.of(RolloutTask.Action.DEPLOY_NEW_JOB, "agent4"), RolloutTask.of(RolloutTask.Action.AWAIT_RUNNING, "agent4"), RolloutTask.of(RolloutTask.Action.UNDEPLOY_OLD_JOBS, "agent4"));
assertEquals(expected, tasks);
}
Aggregations