Skip to content

Commit

Permalink
Ensure ec2_instance tests filter correctly (#1505) (#1506)
Browse files Browse the repository at this point in the history
[PR #1505/116f882f backport][stable-5] Ensure ec2_instance tests filter correctly

This is a backport of PR #1505 as merged into main (116f882).
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
Reviewed-by: Mark Chappell
  • Loading branch information
patchback[bot] authored May 3, 2023
1 parent 681d125 commit e71a396
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 e71a396

Please sign in to comment.