Skip to content

Commit

Permalink
Added test to validate commits with no cluster
Browse files Browse the repository at this point in the history
  • Loading branch information
markotting committed Mar 18, 2024
1 parent 4de8ebd commit eb16fcf
Showing 1 changed file with 16 additions and 4 deletions.
20 changes: 16 additions & 4 deletions tests/integration/targets/ecs_cluster/tasks/20_ecs_service.yml
Original file line number Diff line number Diff line change
Expand Up @@ -400,7 +400,6 @@

- name: obtain facts for existing service in the cluster
ecs_service_info:
cluster: "{{ ecs_cluster_name }}"
service: "{{ ecs_service_name }}"
details: true
events: false
Expand Down Expand Up @@ -437,6 +436,19 @@
that:
- "'networkConfiguration' in ecs_service_info.services[0]"

- name: obtain facts for all clusters
ecs_service_info:
details: true
events: false
register: ecs_service_info

- name: assert that service info is available
assert:
that:
- "ecs_service_info.services|length == 1"
- "ecs_service_info.services_not_running|length == 0"
- "ecs_service_info.services[0].clusterArn == ecs_cluster_name"

- name: attempt to get facts from missing task definition
ecs_taskdefinition_info:
task_definition: "{{ ecs_task_name }}-vpc:{{ ecs_task_definition.taskdefinition.revision + 1}}"
Expand Down Expand Up @@ -547,17 +559,17 @@
>> "rolloutStateReason": "ECS deployment ecs-svc/5156684577543126023 in progress.",
constraints and placement strategies are only changeable if the rollout state is "COMPLETED"
a) ecs_service has currently no waiter function. so this is a DIY waiter
b) the state reached never "COMPLETED" because something if wrong with the ECS EC2 Instances
or the network setup. The EC2 instance never arrived as an active instance in the cluster.
>> no container instance met all of its requirements. Reason: No Container Instances were found in your cluster.
>> For more information, see the Troubleshooting section of the Amazon ECS Developer Guide.
>> ec2_instance networking does not work correctly, no instance available for the cluster
Because all of this, all following tasks, that test the change of a constraint or placement stragegy are
using `force_new_deployment: true`. That ignores a) and b).
using `force_new_deployment: true`. That ignores a) and b).
ignore_errors: true
ecs_service_info:
name: "{{ ecs_service_name }}-constraint"
Expand Down

0 comments on commit eb16fcf

Please sign in to comment.