From c9f549e9c1dbec7584cd7587010f2d84f3d32012 Mon Sep 17 00:00:00 2001 From: Matt Clay Date: Mon, 25 Feb 2019 11:45:49 -0800 Subject: [PATCH] Fix integration test script coverage reporting. Code coverage reporting was ignoring scripts executed during integration tests when those scripts resided in the temporary working directory used during an integration test run. --- test/runner/lib/cover.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/test/runner/lib/cover.py b/test/runner/lib/cover.py index 3d7e1621267..35e8bccd944 100644 --- a/test/runner/lib/cover.py +++ b/test/runner/lib/cover.py @@ -122,6 +122,11 @@ def command_coverage_combine(args): new_name = re.sub('^(/.*?)?/root/ansible/', root_path, filename) display.info('%s -> %s' % (filename, new_name), verbosity=3) filename = new_name + elif '/.ansible/test/tmp/' in filename: + # Rewrite the path of code running from an integration test temporary directory. + new_name = re.sub(r'^.*/\.ansible/test/tmp/[^/]+/', root_path, filename) + display.info('%s -> %s' % (filename, new_name), verbosity=3) + filename = new_name if group not in groups: groups[group] = {}