Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,18 +23,20 @@ install:
- echo Installed Pythons
- dir c:\Python*

- set PATH=C:\Python36;C:\Python36\Scripts;%PATH%

- if "%TOXENV%" == "pypy" call scripts\install-pypy.bat

- C:\Python36\python -m pip install --upgrade pip
- C:\Python36\python -m pip install --upgrade --pre tox
- python -m pip install --upgrade pip
- python -m pip install --upgrade --pre tox

build: false # Not a C# project, build stuff at the test step instead.

before_test:
- call scripts\prepare-coverage.bat

test_script:
- C:\Python36\python -m tox
- python -m tox

on_success:
- call scripts\upload-coverage.bat
Expand Down
12 changes: 12 additions & 0 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ variables:
PYTEST_ADDOPTS: "--junitxml=build/test-results/$(tox.env).xml"
python.needs_vc: False
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:

Expand Down Expand Up @@ -34,6 +38,9 @@ jobs:
python.version: 'pypy'
tox.env: 'pypy'
python.exe: 'pypy'
_PYTEST_TOX_COVERAGE_RUN: ""
_PYTEST_TOX_EXTRA_DEP: ""
PYTEST_NO_COVERAGE: "1"
py34:
python.version: '3.4'
tox.env: 'py34'
Expand Down Expand Up @@ -99,3 +106,8 @@ jobs:
testResultsFiles: 'build/test-results/$(tox.env).xml'
testRunTitle: '$(tox.env)'
condition: succeededOrFailed()

- script: call scripts\upload-coverage.bat
displayName: 'Upload coverage'
env:
CODECOV_TOKEN: $(CODECOV_TOKEN)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is CODECOV_TOKEN configured through their UI?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, as a secret variable. 👍

File renamed without changes.
15 changes: 10 additions & 5 deletions scripts/upload-coverage.bat
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
REM script called by AppVeyor to combine and upload coverage information to codecov
if not defined PYTEST_NO_COVERAGE (
echo Prepare to upload coverage information
C:\Python36\Scripts\pip install codecov
C:\Python36\Scripts\coverage combine
C:\Python36\Scripts\coverage xml --ignore-errors
C:\Python36\Scripts\coverage report -m --ignore-errors
scripts\appveyor-retry C:\Python36\Scripts\codecov --required -X gcov pycov search -f coverage.xml --flags windows
if defined CODECOV_TOKEN (
echo CODECOV_TOKEN defined
) else (
echo CODECOV_TOKEN NOT defined
)
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 (
echo Skipping coverage upload, PYTEST_NO_COVERAGE is set
)