Skip to content

Commit dc5db5d

Browse files
committed
Improve ADO logs
1 parent cfb3e57 commit dc5db5d

File tree

1 file changed

+20
-2
lines changed

1 file changed

+20
-2
lines changed

azure-pipelines.yml

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,5 +37,23 @@ steps:
3737

3838
- script: |
3939
pip install pytest pytest-azurepipelines
40-
pytest
41-
displayName: 'pytest'
40+
mkdir -p test-results
41+
set -o pipefail
42+
pytest -vv --junitxml=test-results/junit.xml 2>&1 | tee test-results/pytest.log
43+
displayName: 'pytest (verbose + junit + log)'
44+
45+
- task: PublishTestResults@2
46+
displayName: 'Publish test results'
47+
condition: succeededOrFailed()
48+
inputs:
49+
testResultsFormat: 'JUnit'
50+
testResultsFiles: 'test-results/junit.xml'
51+
failTaskOnFailedTests: true
52+
testRunTitle: 'Python $(python.version) pytest'
53+
54+
- task: PublishPipelineArtifact@1
55+
displayName: 'Publish pytest log artifact'
56+
condition: succeededOrFailed()
57+
inputs:
58+
targetPath: 'test-results'
59+
artifact: 'pytest-logs-$(python.version)'

0 commit comments

Comments
 (0)