Skip to content

Commit ab0fcb9

Browse files
authored
Code coverage enable html report directory (sonic-net#914)
1 parent ee1a59c commit ab0fcb9

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

.azure-pipelines/build-template.yml

+4-1
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,9 @@ jobs:
124124
set -ex
125125
make check
126126
gcovr --version
127-
gcovr -r ./ -e ".+/saimetadata.c" -e ".+/json.hpp" -e "swss/.+" --exclude-unreachable-branches --exclude-throw-branches -x -o coverage.xml
127+
gcovr -r ./ -e ".+/saimetadata.c" -e ".+/json.hpp" -e "swss/.+" -e ".*/.libs/.*" -e ".*/debian/.*" --exclude-unreachable-branches --exclude-throw-branches -x -o coverage.xml
128+
mkdir -p htmlcov
129+
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
128130
displayName: "Run sonic sairedis unit tests"
129131
- publish: $(System.DefaultWorkingDirectory)/
130132
artifact: ${{ parameters.artifact_name }}
@@ -142,6 +144,7 @@ jobs:
142144
inputs:
143145
codeCoverageTool: Cobertura
144146
summaryFileLocation: '$(System.DefaultWorkingDirectory)/coverage.xml'
147+
reportDirectory: '$(System.DefaultWorkingDirectory)/htmlcov/'
145148
displayName: 'Publish test coverage'
146149
- script: |
147150
pwd

azure-pipelines.yml

+1
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ stages:
2727
artifact_name: sonic-sairedis
2828
syslog_artifact_name: sonic-sairedis.syslog
2929
run_unit_test: true
30+
archive_gcov: true
3031

3132
- stage: BuildArm
3233
dependsOn: Build

0 commit comments

Comments
 (0)