From 983f0ad5a0fdd384744a35d6d011c7c9cadd6c7c Mon Sep 17 00:00:00 2001 From: Matt Clay Date: Tue, 10 Sep 2019 12:49:23 -0700 Subject: [PATCH] Properly exclude tests/output/ from code coverage. --- .../fragments/ansible-test-collections-coverage-noise.yml | 2 ++ test/lib/ansible_test/_internal/coverage_util.py | 6 +++--- 2 files changed, 5 insertions(+), 3 deletions(-) create mode 100644 changelogs/fragments/ansible-test-collections-coverage-noise.yml diff --git a/changelogs/fragments/ansible-test-collections-coverage-noise.yml b/changelogs/fragments/ansible-test-collections-coverage-noise.yml new file mode 100644 index 00000000000..781f192c1d0 --- /dev/null +++ b/changelogs/fragments/ansible-test-collections-coverage-noise.yml @@ -0,0 +1,2 @@ +bugfixes: + - ansible-test now properly excludes the ``tests/output/`` directory from code coverage diff --git a/test/lib/ansible_test/_internal/coverage_util.py b/test/lib/ansible_test/_internal/coverage_util.py index d062ea17a7f..6d70ba6ad06 100644 --- a/test/lib/ansible_test/_internal/coverage_util.py +++ b/test/lib/ansible_test/_internal/coverage_util.py @@ -111,11 +111,11 @@ include = # temporary work-around for import sanity test coverage_config += ''' include = - %s/* + %s/* omit = - */test/results/* -''' % data_context().content.root + %s/* +''' % (data_context().content.root, os.path.join(data_context().content.root, data_context().content.results_path)) else: coverage_config += ''' include =