1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

Deduplicate arcs when combining coverage data. (#22022)

This commit is contained in:
Matt Clay 2017-02-27 15:46:15 -08:00 committed by GitHub
parent e3107cdeb6
commit c87ebb6215

View file

@ -60,7 +60,7 @@ def command_coverage_combine(args):
continue continue
for filename in original.measured_files(): for filename in original.measured_files():
arcs = original.arcs(filename) arcs = set(original.arcs(filename))
if '/ansible_modlib.zip/ansible/' in filename: if '/ansible_modlib.zip/ansible/' in filename:
new_name = re.sub('^.*/ansible_modlib.zip/ansible/', ansible_path, filename) new_name = re.sub('^.*/ansible_modlib.zip/ansible/', ansible_path, filename)
@ -77,9 +77,9 @@ def command_coverage_combine(args):
filename = new_name filename = new_name
if filename not in arc_data: 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() updated = coverage.CoverageData()
@ -88,7 +88,7 @@ def command_coverage_combine(args):
display.warning('Invalid coverage path: %s' % filename) display.warning('Invalid coverage path: %s' % filename)
continue continue
updated.add_arcs({filename: arc_data[filename]}) updated.add_arcs({filename: list(arc_data[filename])})
if not args.explain: if not args.explain:
updated.write_file(COVERAGE_FILE) updated.write_file(COVERAGE_FILE)