Merge pull request #4831 from nicoddemus/codocov-azure
Upload code coverage from azure
This commit is contained in:
commit
ee62674322
|
@ -23,10 +23,12 @@ install:
|
||||||
- echo Installed Pythons
|
- echo Installed Pythons
|
||||||
- dir c:\Python*
|
- dir c:\Python*
|
||||||
|
|
||||||
|
- set PATH=C:\Python36;C:\Python36\Scripts;%PATH%
|
||||||
|
|
||||||
- if "%TOXENV%" == "pypy" call scripts\install-pypy.bat
|
- if "%TOXENV%" == "pypy" call scripts\install-pypy.bat
|
||||||
|
|
||||||
- C:\Python36\python -m pip install --upgrade pip
|
- python -m pip install --upgrade pip
|
||||||
- C:\Python36\python -m pip install --upgrade --pre tox
|
- python -m pip install --upgrade --pre tox
|
||||||
|
|
||||||
build: false # Not a C# project, build stuff at the test step instead.
|
build: false # Not a C# project, build stuff at the test step instead.
|
||||||
|
|
||||||
|
@ -34,7 +36,7 @@ before_test:
|
||||||
- call scripts\prepare-coverage.bat
|
- call scripts\prepare-coverage.bat
|
||||||
|
|
||||||
test_script:
|
test_script:
|
||||||
- C:\Python36\python -m tox
|
- python -m tox
|
||||||
|
|
||||||
on_success:
|
on_success:
|
||||||
- call scripts\upload-coverage.bat
|
- call scripts\upload-coverage.bat
|
||||||
|
|
|
@ -6,6 +6,10 @@ variables:
|
||||||
PYTEST_ADDOPTS: "--junitxml=build/test-results/$(tox.env).xml"
|
PYTEST_ADDOPTS: "--junitxml=build/test-results/$(tox.env).xml"
|
||||||
python.needs_vc: False
|
python.needs_vc: False
|
||||||
python.exe: "python"
|
python.exe: "python"
|
||||||
|
COVERAGE_FILE: "$(Build.Repository.LocalPath)/.coverage"
|
||||||
|
COVERAGE_PROCESS_START: "$(Build.Repository.LocalPath)/.coveragerc"
|
||||||
|
_PYTEST_TOX_COVERAGE_RUN: "coverage run -m"
|
||||||
|
_PYTEST_TOX_EXTRA_DEP: "coverage-enable-subprocess"
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
|
||||||
|
@ -34,6 +38,9 @@ jobs:
|
||||||
python.version: 'pypy'
|
python.version: 'pypy'
|
||||||
tox.env: 'pypy'
|
tox.env: 'pypy'
|
||||||
python.exe: 'pypy'
|
python.exe: 'pypy'
|
||||||
|
_PYTEST_TOX_COVERAGE_RUN: ""
|
||||||
|
_PYTEST_TOX_EXTRA_DEP: ""
|
||||||
|
PYTEST_NO_COVERAGE: "1"
|
||||||
py34:
|
py34:
|
||||||
python.version: '3.4'
|
python.version: '3.4'
|
||||||
tox.env: 'py34'
|
tox.env: 'py34'
|
||||||
|
@ -99,3 +106,8 @@ jobs:
|
||||||
testResultsFiles: 'build/test-results/$(tox.env).xml'
|
testResultsFiles: 'build/test-results/$(tox.env).xml'
|
||||||
testRunTitle: '$(tox.env)'
|
testRunTitle: '$(tox.env)'
|
||||||
condition: succeededOrFailed()
|
condition: succeededOrFailed()
|
||||||
|
|
||||||
|
- script: call scripts\upload-coverage.bat
|
||||||
|
displayName: 'Upload coverage'
|
||||||
|
env:
|
||||||
|
CODECOV_TOKEN: $(CODECOV_TOKEN)
|
||||||
|
|
|
@ -1,11 +1,16 @@
|
||||||
REM script called by AppVeyor to combine and upload coverage information to codecov
|
REM script called by AppVeyor to combine and upload coverage information to codecov
|
||||||
if not defined PYTEST_NO_COVERAGE (
|
if not defined PYTEST_NO_COVERAGE (
|
||||||
echo Prepare to upload coverage information
|
echo Prepare to upload coverage information
|
||||||
C:\Python36\Scripts\pip install codecov
|
if defined CODECOV_TOKEN (
|
||||||
C:\Python36\Scripts\coverage combine
|
echo CODECOV_TOKEN defined
|
||||||
C:\Python36\Scripts\coverage xml --ignore-errors
|
) else (
|
||||||
C:\Python36\Scripts\coverage report -m --ignore-errors
|
echo CODECOV_TOKEN NOT defined
|
||||||
scripts\appveyor-retry C:\Python36\Scripts\codecov --required -X gcov pycov search -f coverage.xml --flags windows
|
)
|
||||||
|
python -m pip install codecov
|
||||||
|
coverage combine
|
||||||
|
coverage xml --ignore-errors
|
||||||
|
coverage report -m --ignore-errors
|
||||||
|
scripts\retry codecov --required -X gcov pycov search -f coverage.xml --flags windows
|
||||||
) else (
|
) else (
|
||||||
echo Skipping coverage upload, PYTEST_NO_COVERAGE is set
|
echo Skipping coverage upload, PYTEST_NO_COVERAGE is set
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in New Issue