#2084: publish coverage report + more verbose test output

This commit is contained in:
Czar Echavez
2023-12-01 10:32:48 +00:00
parent f1c706631f
commit 4ad93b0961
2 changed files with 10 additions and 2 deletions

View File

@@ -98,14 +98,21 @@ stages:
displayName: 'Perform PrimAITE Setup'
- script: |
pytest --cov=src --cov-report=html --cov-report=xml --cov-fail-under=80
pytest -v tests/ --cov=src/ -o junit_family=xunit2 --junitxml=junit/test-results.xml --cov-report xml:coverage.xml --cov-report html:src/coverage/html
displayName: 'Run tests and code coverage'
- task: PublishTestResults@2
condition: succeededOrFailed()
inputs:
testRunner: JUnit
testResultsFiles: 'junit/**.xml'
testRunTitle: 'Publish test results'
- task: PublishCodeCoverageResults@1
displayName: 'Publish coverage report'
inputs:
codeCoverageTool: Cobertura
summaryFileLocation: $(System.DefaultWorkingDirectory)/coverage.xml
pathToSources: $(System.DefaultWorkingDirectory)/src/
reportDirectory: $(System.DefaultWorkingDirectory)/htmlcov/
reportDirectory: $(System.DefaultWorkingDirectory)/src/coverage/html/
failIfCoverageEmpty: true

1
.gitignore vendored
View File

@@ -37,6 +37,7 @@ pip-log.txt
pip-delete-this-directory.txt
# Unit test / coverage reports
junit/
htmlcov/
.tox/
.nox/