Merge pull request #4841 from blueyed/coverage-source

coverage: use run.include, remove --ignore-errors, send TOXENV as name to codecov
This commit is contained in:
Daniel Hahler 2019-02-27 13:16:31 +01:00 committed by GitHub
commit e711a6c275
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 14 additions and 7 deletions

View File

@ -1,5 +1,11 @@
[run] [run]
source = pytest,_pytest,testing/ 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 parallel = 1
branch = 1 branch = 1

View File

@ -103,9 +103,9 @@ after_success:
# Add last TOXENV to $PATH. # Add last TOXENV to $PATH.
PATH="$PWD/.tox/${TOXENV##*,}/bin:$PATH" PATH="$PWD/.tox/${TOXENV##*,}/bin:$PATH"
coverage combine coverage combine
coverage xml --ignore-errors coverage xml
coverage report -m --ignore-errors 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 fi
notifications: notifications:

View File

@ -120,3 +120,4 @@ jobs:
condition: eq(variables['PYTEST_COVERAGE'], '1') condition: eq(variables['PYTEST_COVERAGE'], '1')
env: env:
CODECOV_TOKEN: $(CODECOV_TOKEN) CODECOV_TOKEN: $(CODECOV_TOKEN)
PYTEST_CODECOV_NAME: $(tox.env)

View File

@ -8,9 +8,9 @@ if "%PYTEST_COVERAGE%" == "1" (
) )
python -m pip install codecov python -m pip install codecov
coverage combine coverage combine
coverage xml --ignore-errors coverage xml
coverage report -m --ignore-errors 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 ( ) else (
echo Skipping coverage upload, PYTEST_COVERAGE=%PYTEST_COVERAGE% echo Skipping coverage upload, PYTEST_COVERAGE=%PYTEST_COVERAGE%
) )