Skip to content

Commit

Permalink
Ensure ec2_instance tests filter correctly (ansible-collections#1505)
Browse files Browse the repository at this point in the history
Ensure ec2_instance tests filter correctly

SUMMARY
Multiple instances test picks up instances from other tests when run concurrently. Use tag filters to prevent this.
ISSUE TYPE

Bugfix Pull Request

COMPONENT NAME
tests/integration/targets/ec2_instance_instance_multiple/tasks/main.yml
ADDITIONAL INFORMATION
in the example here: https://39d585ceb0884fd58f3d-34626b4834f21056500b5be2783f089d.ssl.cf5.rackcdn.com/1500/eb91ab4ac10d4af904d629a7296502aff59d9d06/check/integration-amazon.aws-1/86d0d4c/job-output.txt
the Create multiple instance (check_mode) task erroneously picks up instances from the ec2_instance_instance_minimal test target.

Reviewed-by: Alina Buzachis
  • Loading branch information
jillr authored May 3, 2023
1 parent 7ae909b commit 116f882
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions changelogs/fragments/1505-ec2_instance_test_fixes.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
trivial:
- ec2_instance - Add filter statement to integration tests to prevent test collisions (https://github.com/ansible-collections/amazon.aws/pull/1505)
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
state: present
tags:
TestId: "{{ ec2_instance_tag_TestId }}"
filters:
"tag:TestId": "{{ ec2_instance_tag_TestId }}"
register: create_multiple_instances
check_mode: true

Expand All @@ -35,6 +37,8 @@
state: present
tags:
TestId: "{{ ec2_instance_tag_TestId }}"
filters:
"tag:TestId": "{{ ec2_instance_tag_TestId }}"
wait: true
register: create_multiple_instances

Expand Down

0 comments on commit 116f882

Please sign in to comment.