Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make ansible-test less noisy for change detection. #53497

Merged
merged 2 commits into from
Mar 8, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
19 changes: 16 additions & 3 deletions test/runner/lib/classification.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,10 @@ def categorize_changes(args, paths, verbose_command=None):
if not dependent_paths:
continue

display.info('Expanded "%s" to %d dependent file(s):' % (path, len(dependent_paths)), verbosity=1)
display.info('Expanded "%s" to %d dependent file(s):' % (path, len(dependent_paths)), verbosity=2)

for dependent_path in dependent_paths:
display.info(dependent_path, verbosity=1)
display.info(dependent_path, verbosity=2)
additional_paths.add(dependent_path)

additional_paths -= set(paths) # don't count changed paths as additional paths
Expand All @@ -95,6 +95,8 @@ def categorize_changes(args, paths, verbose_command=None):

display.info('Mapping %d changed file(s) to tests.' % len(paths))

none_count = 0

for path in paths:
tests = mapper.classify(path)

Expand Down Expand Up @@ -125,14 +127,25 @@ def categorize_changes(args, paths, verbose_command=None):
else:
result = '%s' % tests

display.info('%s -> %s' % (path, result), verbosity=1)
if not tests.get(verbose_command):
# minimize excessive output from potentially thousands of files which do not trigger tests
none_count += 1
verbosity = 2
else:
verbosity = 1

if args.verbosity >= verbosity:
display.info('%s -> %s' % (path, result), verbosity=1)

for command, target in tests.items():
commands[command].add(target)

if focused_target:
focused_commands[command].add(target)

if none_count > 0 and args.verbosity < 2:
display.notice('Omitted %d file(s) that triggered no tests.' % none_count)

for command in commands:
commands[command].discard('none')

Expand Down