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:
parent
e3107cdeb6
commit
c87ebb6215
1 changed files with 4 additions and 4 deletions
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue