Skip to content

Commit

Permalink
Properly collect coverage on azure
Browse files Browse the repository at this point in the history
Signed-off-by: Aleksei Stepanov <penguinolog@gmail.com>
  • Loading branch information
penguinolog committed Apr 30, 2019
1 parent 756294c commit d1c92f8
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
14 changes: 10 additions & 4 deletions .azure_pipelines/run_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,13 @@ jobs:
- script: |
pip install -U wheel
python setup.py bdist_wheel
pip install --pre --no-index -f dist exec-helpers
python setup.py develop -v
displayName: Build and install
- script: |
pip install asynctest mock pytest pytest-mock pytest-asyncio pytest-sugar
pip install asynctest mock pytest pytest-mock pytest-asyncio pytest-sugar pytest-cov
pytest -vvv --junitxml=unit_result.xml test
pytest -vvv --junitxml=unit_result.xml --cov=exec_helpers --cov-report=xml --cov-report=html --cov-report term test
displayName: PyTest
- task: PublishTestResults@2
Expand All @@ -57,3 +56,10 @@ jobs:
testResultsFormat: "JUnit"
testResultsFiles: ${{ format('$(System.DefaultWorkingDirectory)/unit_result.xml') }}
testRunTitle: ${{ format('{0}_{1}_{2}', parameters.name, parameters.architecture, parameters.kind) }}

- ${{ if ne(parameters.kind, 'cython') }}:
- task: PublishCodeCoverageResults@1
inputs:
codeCoverageTool: Cobertura
summaryFileLocation: ${{ format('$(System.DefaultWorkingDirectory)/coverage.xml') }}
reportDirectory: ${{ format('$(System.DefaultWorkingDirectory)/htmlcov') }}
2 changes: 1 addition & 1 deletion .coveragerc
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ source =
exec_helpers
omit =
test/*

branch = True
[report]
exclude_lines =
# Have to re-enable the standard pragma
Expand Down

0 comments on commit d1c92f8

Please sign in to comment.