From c1b0545d5c663f809bcc420fe7e0eb7d60915112 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bern=C3=A1t=20G=C3=A1bor?= Date: Thu, 29 Dec 2022 20:28:42 -0800 Subject: [PATCH 1/2] Fix coverage reporting MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Bernát Gábor --- pyproject.toml | 3 ++- tox.ini | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 053fc2ad0..146056d20 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -111,11 +111,12 @@ paths.source = [ ".tox\\*\\site-packages", # pypy3.7 ] paths.other = [".", "*/virtualenv", "*\\virtualenv"] -report.fail_under = 76 +report.fail_under = 10 run.source = ["${_COVERAGE_SRC}", "tests"] run.dynamic_context = "test_function" run.parallel = true run.plugins = ["covdefaults"] +run.relative_files = true [tool.black] line-length = 120 diff --git a/tox.ini b/tox.ini index ddaf8eca1..2e5186cb9 100644 --- a/tox.ini +++ b/tox.ini @@ -20,7 +20,7 @@ extras = test commands = coverage erase - coverage run -m pytest {posargs:--junitxml {toxworkdir}/junit.{envname}.xml tests --int} + coverage run -m pytest {posargs:--junitxml {toxworkdir}/junit.{envname}.xml tests/unit/config --int} coverage combine coverage report --skip-covered --show-missing coverage xml -o {toxworkdir}/coverage.{envname}.xml From e0741101a09c40ba2433e289653a272fe0ca7f08 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bern=C3=A1t=20G=C3=A1bor?= Date: Thu, 29 Dec 2022 21:53:06 -0800 Subject: [PATCH 2/2] Check no relative MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Bernát Gábor --- pyproject.toml | 21 +++++++-------------- tox.ini | 2 +- 2 files changed, 8 insertions(+), 15 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 146056d20..f14b4173c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -22,7 +22,7 @@ dependencies = [ ] optional-dependencies.test = [ "covdefaults>=2.2.2", - "coverage>=7.0.1", + "coverage>=7.0.2", "coverage-enable-subprocess>=1", "flaky>=3.7", "packaging>=22", @@ -98,20 +98,13 @@ html.show_contexts = true html.skip_covered = false report.omit = [ # site.py is ran before the coverage can be enabled, no way to measure coverage on this - "src/virtualenv/create/via_global_ref/builtin/python2/site.py", - "src/virtualenv/create/via_global_ref/_virtualenv.py", - "src/virtualenv/activation/python/activate_this.py", - "src/virtualenv/seed/wheels/embed/pip-*.whl/*", + "**/src/virtualenv/create/via_global_ref/builtin/python2/site.py", + "**/src/virtualenv/create/via_global_ref/_virtualenv.py", + "**/src/virtualenv/activation/python/activate_this.py", + "**/src/virtualenv/seed/wheels/embed/pip-*.whl/pip/**", ] -paths.source = [ - "src", - ".tox/*/lib/*/site-packages", # pypy3.8 + cpython - ".tox/*/site-packages", # pypy3.7 - ".tox\\*\\Lib\\site-packages", # pypy3.8 + cpython - ".tox\\*\\site-packages", # pypy3.7 -] -paths.other = [".", "*/virtualenv", "*\\virtualenv"] -report.fail_under = 10 +paths.source = ["src", "**/site-packages"] +report.fail_under = 76 run.source = ["${_COVERAGE_SRC}", "tests"] run.dynamic_context = "test_function" run.parallel = true diff --git a/tox.ini b/tox.ini index 2e5186cb9..ddaf8eca1 100644 --- a/tox.ini +++ b/tox.ini @@ -20,7 +20,7 @@ extras = test commands = coverage erase - coverage run -m pytest {posargs:--junitxml {toxworkdir}/junit.{envname}.xml tests/unit/config --int} + coverage run -m pytest {posargs:--junitxml {toxworkdir}/junit.{envname}.xml tests --int} coverage combine coverage report --skip-covered --show-missing coverage xml -o {toxworkdir}/coverage.{envname}.xml