I've setup my open source project to run CI with Azure Pipelines, and am collecting code coverage following the example from the Azure pipelines docs on how to test Python apps.
This seems to work pretty well, but the code coverage statistics seem to only pick up a test results from a single job (at random). To get complete coverage for my project (e.g., for platform dependent code), I really need to aggregate coverage across all of the test jobs.
Here are the relevant tasks from my pipeline:
- bash: |
source activate test_env
pytest xarray --junitxml=junit/test-results.xml \
--cov=xarray --cov-config=ci/.coveragerc --cov-report=xml
displayName: Run tests
- task: PublishCodeCoverageResults@1
inputs:
codeCoverageTool: Cobertura
summaryFileLocation: '$(System.DefaultWorkingDirectory)/**/coverage.xml'
reportDirectory: '$(System.DefaultWorkingDirectory)/**/htmlcov'
What's the right way to configure Azure to show this information?
I've tried adding --cov-append
into my pytest
invocation but that doesn't seem to make a difference.