Search in sources :

Example 16 with RolloutTask

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);
}
Also used : RolloutTask(com.spotify.helios.common.descriptors.RolloutTask) DeploymentGroup(com.spotify.helios.common.descriptors.DeploymentGroup) Test(org.junit.Test)

Aggregations

RolloutTask (com.spotify.helios.common.descriptors.RolloutTask)16 Test (org.junit.Test)11 DeploymentGroup (com.spotify.helios.common.descriptors.DeploymentGroup)10 ZooKeeperOperation (com.spotify.helios.servicescommon.coordination.ZooKeeperOperation)6 DeploymentGroupTasks (com.spotify.helios.common.descriptors.DeploymentGroupTasks)5 ZooKeeperClient (com.spotify.helios.servicescommon.coordination.ZooKeeperClient)5 Map (java.util.Map)5 DeploymentGroupStatus (com.spotify.helios.common.descriptors.DeploymentGroupStatus)4 JsonParseException (com.fasterxml.jackson.core.JsonParseException)2 JsonMappingException (com.fasterxml.jackson.databind.JsonMappingException)2 ImmutableMap (com.google.common.collect.ImmutableMap)2 HeliosRuntimeException (com.spotify.helios.common.HeliosRuntimeException)2 Job (com.spotify.helios.common.descriptors.Job)2 CreateEmpty (com.spotify.helios.servicescommon.coordination.CreateEmpty)2 SetData (com.spotify.helios.servicescommon.coordination.SetData)2 TypeReference (com.fasterxml.jackson.core.type.TypeReference)1 Function (com.google.common.base.Function)1 Joiner (com.google.common.base.Joiner)1 MoreObjects (com.google.common.base.MoreObjects)1 Optional.fromNullable (com.google.common.base.Optional.fromNullable)1