diff --git a/.azure/azure-ci-build-pipeline.yaml b/.azure/azure-ci-build-pipeline.yaml index 05de0050..58d5454e 100644 --- a/.azure/azure-ci-build-pipeline.yaml +++ b/.azure/azure-ci-build-pipeline.yaml @@ -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 diff --git a/.gitignore b/.gitignore index f6231bac..ef842c6e 100644 --- a/.gitignore +++ b/.gitignore @@ -37,6 +37,7 @@ pip-log.txt pip-delete-this-directory.txt # Unit test / coverage reports +junit/ htmlcov/ .tox/ .nox/