From 9a8350fd8f7b81525144ac6d18280a08b9a91cae Mon Sep 17 00:00:00 2001 From: Czar Echavez Date: Fri, 1 Dec 2023 15:49:20 +0000 Subject: [PATCH] #2084: artifact the report --- .azure/azure-ci-build-pipeline.yaml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.azure/azure-ci-build-pipeline.yaml b/.azure/azure-ci-build-pipeline.yaml index 4c5afed8..61b4cfc3 100644 --- a/.azure/azure-ci-build-pipeline.yaml +++ b/.azure/azure-ci-build-pipeline.yaml @@ -98,7 +98,7 @@ stages: displayName: 'Perform PrimAITE Setup' - script: | - pytest -v tests/ --cov=src/ -o junit_family=xunit2 --junitxml=junit/test-results.xml --cov-report xml:$(System.DefaultWorkingDirectory)/coverage.xml --cov-report html:$(System.DefaultWorkingDirectory)/htmlcov --cov-report term + pytest -v tests/unit_tests --cov=src/ -o junit_family=xunit2 --junitxml=junit/test-results.xml --cov-report xml:$(System.DefaultWorkingDirectory)/coverage.xml --cov-report html:$(System.DefaultWorkingDirectory)/htmlcov --cov-report term displayName: 'Run tests and code coverage' - task: PublishTestResults@2 @@ -108,12 +108,15 @@ stages: testResultsFiles: 'junit/**.xml' testRunTitle: 'Publish test results' + - publish: $(System.DefaultWorkingDirectory)/**/htmlcov/ + artifact: coverage_report + - 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)/**/htmlcov/' additionalCodeCoverageFiles: '$(System.DefaultWorkingDirectory)/**/htmlcov/*.*' failIfCoverageEmpty: true