Skip to content

Commit b74c927

Browse files
committed
Publish unit test results and code coverage
Also, run tests with pytest, which needs to be installed in the agent. Fixes #23.
1 parent bc6b0fc commit b74c927

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

azure-pipelines.yml

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,24 @@ jobs:
2929
versionSpec: '$(python.version)'
3030
architecture: 'x64'
3131

32-
- script: python -m unittest discover
32+
- script: |
33+
pip install pytest
34+
pip install pytest-cov
35+
pytest tests --doctest-modules --junitxml=junit/test-results.xml --cov=callgraph --cov-report=xml --cov-report=html
3336
displayName: 'Unit Tests'
3437
38+
- task: PublishTestResults@2
39+
condition: succeededOrFailed()
40+
inputs:
41+
testResultsFiles: '**/test-*.xml'
42+
testRunTitle: 'Publish test results for Python $(python.version)'
43+
44+
- task: PublishCodeCoverageResults@1
45+
inputs:
46+
codeCoverageTool: Cobertura
47+
summaryFileLocation: '$(System.DefaultWorkingDirectory)/**/coverage.xml'
48+
reportDirectory: '$(System.DefaultWorkingDirectory)/**/htmlcov'
49+
3550
- job: 'GenerateSamples'
3651
dependsOn: 'Test'
3752
pool:

0 commit comments

Comments
 (0)