mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-04 15:40:20 -07:00
Handle non-target file deps for integration tests.
Some integration test targets have dependencies on files outside the `test/integration/targets/` directory tree. Changes to these dependencies can result in unexpected test failures since they do not trigger integration tests which depend on them.
This commit is contained in:
parent
3db6b9b416
commit
6a0452559b
7 changed files with 53 additions and 0 deletions
|
@ -626,6 +626,11 @@ class IntegrationTarget(CompletionTarget):
|
|||
if self.type not in ('script', 'role'):
|
||||
groups.append('hidden')
|
||||
|
||||
# Collect file paths before group expansion to avoid including the directories.
|
||||
# Ignore references to test targets, as those must be defined using `needs/target/*` or other target references.
|
||||
self.needs_file = tuple(sorted(set('/'.join(g.split('/')[2:]) for g in groups if
|
||||
g.startswith('needs/file/') and not g.startswith('needs/file/test/integration/targets/'))))
|
||||
|
||||
for group in itertools.islice(groups, 0, len(groups)):
|
||||
if '/' in group:
|
||||
parts = group.split('/')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue