From c87ebb62150fdff77f0422c4f2c63aea03f73383 Mon Sep 17 00:00:00 2001 From: Matt Clay Date: Mon, 27 Feb 2017 15:46:15 -0800 Subject: [PATCH] Deduplicate arcs when combining coverage data. (#22022) --- test/runner/lib/cover.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/test/runner/lib/cover.py b/test/runner/lib/cover.py index 16ebbc697f6..6d110a662f6 100644 --- a/test/runner/lib/cover.py +++ b/test/runner/lib/cover.py @@ -60,7 +60,7 @@ def command_coverage_combine(args): continue for filename in original.measured_files(): - arcs = original.arcs(filename) + arcs = set(original.arcs(filename)) if '/ansible_modlib.zip/ansible/' in filename: new_name = re.sub('^.*/ansible_modlib.zip/ansible/', ansible_path, filename) @@ -77,9 +77,9 @@ def command_coverage_combine(args): filename = new_name if filename not in arc_data: - arc_data[filename] = [] + arc_data[filename] = set() - arc_data[filename] += arcs + arc_data[filename].update(arcs) updated = coverage.CoverageData() @@ -88,7 +88,7 @@ def command_coverage_combine(args): display.warning('Invalid coverage path: %s' % filename) continue - updated.add_arcs({filename: arc_data[filename]}) + updated.add_arcs({filename: list(arc_data[filename])}) if not args.explain: updated.write_file(COVERAGE_FILE)