Skip to content

Commit

Permalink
Code coverage enable html report directory (sonic-net#914)
Browse files Browse the repository at this point in the history
  • Loading branch information
kcudnik authored Aug 30, 2021
1 parent ee1a59c commit ab0fcb9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
5 changes: 4 additions & 1 deletion .azure-pipelines/build-template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,9 @@ jobs:
set -ex
make check
gcovr --version
gcovr -r ./ -e ".+/saimetadata.c" -e ".+/json.hpp" -e "swss/.+" --exclude-unreachable-branches --exclude-throw-branches -x -o coverage.xml
gcovr -r ./ -e ".+/saimetadata.c" -e ".+/json.hpp" -e "swss/.+" -e ".*/.libs/.*" -e ".*/debian/.*" --exclude-unreachable-branches --exclude-throw-branches -x -o coverage.xml
mkdir -p htmlcov
gcovr -r ./ -e ".+/saimetadata.c" -e ".+/json.hpp" -e "swss/.+" -e ".*/.libs/.*" -e ".*/debian/.*" -e ".+/OidIndexGenerator.h" --exclude-unreachable-branches --exclude-throw-branches --html --html-details -o htmlcov/index.html
displayName: "Run sonic sairedis unit tests"
- publish: $(System.DefaultWorkingDirectory)/
artifact: ${{ parameters.artifact_name }}
Expand All @@ -142,6 +144,7 @@ jobs:
inputs:
codeCoverageTool: Cobertura
summaryFileLocation: '$(System.DefaultWorkingDirectory)/coverage.xml'
reportDirectory: '$(System.DefaultWorkingDirectory)/htmlcov/'
displayName: 'Publish test coverage'
- script: |
pwd
Expand Down
1 change: 1 addition & 0 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ stages:
artifact_name: sonic-sairedis
syslog_artifact_name: sonic-sairedis.syslog
run_unit_test: true
archive_gcov: true

- stage: BuildArm
dependsOn: Build
Expand Down

0 comments on commit ab0fcb9

Please sign in to comment.