From b5cf61312b96ba304c7aa24420a36a8f908e9935 Mon Sep 17 00:00:00 2001 From: Daniel Hahler Date: Tue, 26 Feb 2019 23:30:48 +0100 Subject: [PATCH 1/5] coverage: use source=. and report.include This appears to improve performance - ~4s with `tox -e py37-coverage -- testing/test_collection.py`. --- .coveragerc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.coveragerc b/.coveragerc index 97934dc3b..6cb6f4973 100644 --- a/.coveragerc +++ b/.coveragerc @@ -1,8 +1,11 @@ [run] -source = pytest,_pytest,testing/ +source = . parallel = 1 branch = 1 +[report] +include = src/*, testing/* + [paths] source = src/ .tox/*/lib/python*/site-packages/ From 0138e9cbb001b6ed3aab026737c83642603e9ff1 Mon Sep 17 00:00:00 2001 From: Daniel Hahler Date: Wed, 27 Feb 2019 08:44:11 +0100 Subject: [PATCH 2/5] ci: coverage: remove --ignore-errors This should not be necessary (anymore). --- .travis.yml | 4 ++-- scripts/upload-coverage.bat | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index 9616a0818..7cfc4068a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -103,8 +103,8 @@ after_success: # Add last TOXENV to $PATH. PATH="$PWD/.tox/${TOXENV##*,}/bin:$PATH" coverage combine - coverage xml --ignore-errors - coverage report -m --ignore-errors + coverage xml + coverage report -m bash <(curl -s https://codecov.io/bash) -Z -X gcov -X coveragepy -X search -X xcode -X gcovout -X fix -f coverage.xml -F $TRAVIS_OS_NAME fi diff --git a/scripts/upload-coverage.bat b/scripts/upload-coverage.bat index 2e84f99dd..3f9d423e7 100644 --- a/scripts/upload-coverage.bat +++ b/scripts/upload-coverage.bat @@ -8,8 +8,8 @@ if "%PYTEST_COVERAGE%" == "1" ( ) python -m pip install codecov coverage combine - coverage xml --ignore-errors - coverage report -m --ignore-errors + coverage xml + coverage report -m scripts\retry codecov --required -X gcov pycov search -f coverage.xml --flags windows ) else ( echo Skipping coverage upload, PYTEST_COVERAGE=%PYTEST_COVERAGE% From 5a0f379289dbcec8409ac17cf1ead414f33e0dcc Mon Sep 17 00:00:00 2001 From: Daniel Hahler Date: Wed, 27 Feb 2019 08:46:19 +0100 Subject: [PATCH 3/5] ci: codecov: set name for uploads/builds --- .travis.yml | 2 +- azure-pipelines.yml | 1 + scripts/upload-coverage.bat | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 7cfc4068a..be30f0151 100644 --- a/.travis.yml +++ b/.travis.yml @@ -105,7 +105,7 @@ after_success: coverage combine coverage xml coverage report -m - bash <(curl -s https://codecov.io/bash) -Z -X gcov -X coveragepy -X search -X xcode -X gcovout -X fix -f coverage.xml -F $TRAVIS_OS_NAME + bash <(curl -s https://codecov.io/bash) -Z -X gcov -X coveragepy -X search -X xcode -X gcovout -X fix -f coverage.xml -F $TRAVIS_OS_NAME -n $TOXENV fi notifications: diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 949c39fc4..e27f03ee8 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -120,3 +120,4 @@ jobs: condition: eq(variables['PYTEST_COVERAGE'], '1') env: CODECOV_TOKEN: $(CODECOV_TOKEN) + PYTEST_CODECOV_NAME: $(tox.env) diff --git a/scripts/upload-coverage.bat b/scripts/upload-coverage.bat index 3f9d423e7..ad8092d16 100644 --- a/scripts/upload-coverage.bat +++ b/scripts/upload-coverage.bat @@ -10,7 +10,7 @@ if "%PYTEST_COVERAGE%" == "1" ( coverage combine coverage xml coverage report -m - scripts\retry codecov --required -X gcov pycov search -f coverage.xml --flags windows + scripts\retry codecov --required -X gcov pycov search -f coverage.xml --flags windows --name %PYTEST_CODECOV_NAME% ) else ( echo Skipping coverage upload, PYTEST_COVERAGE=%PYTEST_COVERAGE% ) From 31174f3f8306471dc41d266f1f2831f647b344c2 Mon Sep 17 00:00:00 2001 From: Daniel Hahler Date: Wed, 27 Feb 2019 09:26:29 +0100 Subject: [PATCH 4/5] .coveragerc: fix/tighten paths --- .coveragerc | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/.coveragerc b/.coveragerc index 6cb6f4973..1c20833d1 100644 --- a/.coveragerc +++ b/.coveragerc @@ -7,6 +7,9 @@ branch = 1 include = src/*, testing/* [paths] -source = src/ - .tox/*/lib/python*/site-packages/ - .tox\*\Lib\site-packages\ +source = src/_pytest + .tox/*/lib/python*/site-packages/_pytest/ + .tox\*\Lib\site-packages\pytest\ +source_pytest_py = src/pytest.py + .tox/*/lib/python*/site-packages/pytest.py + .tox\*\Lib\site-packages\pytest.py From ee95d666f8c875a7b4d46b2f4e0ce08cb05a0007 Mon Sep 17 00:00:00 2001 From: Daniel Hahler Date: Wed, 27 Feb 2019 11:32:23 +0100 Subject: [PATCH 5/5] coverage: run.include, drop --ignore-errors, codecov name --- .coveragerc | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/.coveragerc b/.coveragerc index 1c20833d1..5942e71c6 100644 --- a/.coveragerc +++ b/.coveragerc @@ -1,15 +1,15 @@ [run] -source = . +include = + src/* + testing/* + .tox/*/lib/python*/site-packages/_pytest/* + .tox/*/lib/python*/site-packages/pytest.py + .tox\*\Lib\site-packages\_pytest\* + .tox\*\Lib\site-packages\pytest.py parallel = 1 branch = 1 -[report] -include = src/*, testing/* - [paths] -source = src/_pytest - .tox/*/lib/python*/site-packages/_pytest/ - .tox\*\Lib\site-packages\pytest\ -source_pytest_py = src/pytest.py - .tox/*/lib/python*/site-packages/pytest.py - .tox\*\Lib\site-packages\pytest.py +source = src/ + .tox/*/lib/python*/site-packages/ + .tox\*\Lib\site-packages\