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:
Matt Clay 2019-01-12 00:18:17 -08:00
parent 3db6b9b416
commit 6a0452559b
7 changed files with 53 additions and 0 deletions

View file

@ -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('/')