Skip to content

Commit 76b62b0

Browse files
committed
[sonic-utilities]: add code coverage report
Signed-off-by: Guohan Lu <[email protected]>
1 parent b045352 commit 76b62b0

File tree

2 files changed

+31
-0
lines changed

2 files changed

+31
-0
lines changed

jenkins/common/sonic-utilities-build-pr/Jenkinsfile

+14
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,21 @@ pipeline {
4545

4646
always {
4747
junit(allowEmptyResults: true, keepLongStdio: true, testResults: 'sonic-swss-tests/tests/tr.xml')
48+
49+
publishHTML(target: [
50+
allowMissing: false,
51+
alwaysLinkToLastBuild: false,
52+
keepAll: true,
53+
reportDir: 'sonic-utilities/deb_dist/sonic-utilities-1.2/htmlcov',
54+
reportFiles: 'index.html',
55+
reportName: 'RCov Report'
56+
])
57+
58+
publishCoverage(adapters: [
59+
coberturaAdapter('sonic-utilities/deb_dist/sonic-utilities-1.2/coverage.xml')
60+
])
4861
}
62+
4963
success {
5064
archiveArtifacts(artifacts: 'sonic-utilities/deb_dist/python-sonic-utilities_1.2-1_all.deb,wheels/sonic_config_engine-1.0-py2-none-any.whl,wheels/swsssdk-2.0.1-py2-none-any.whl,wheels/sonic_py_common-1.0-py2-none-any.whl,wheels/sonic_py_common-1.0-py3-none-any.whl, sonic-swss-tests/tests/log/**')
5165
}

jenkins/common/sonic-utilities-build/Jenkinsfile

+17
Original file line numberDiff line numberDiff line change
@@ -51,18 +51,35 @@ pipeline {
5151
post {
5252
always {
5353
junit(allowEmptyResults: true, keepLongStdio: true, testResults: 'sonic-swss-tests/tests/tr.xml')
54+
55+
publishHTML(target: [
56+
allowMissing: false,
57+
alwaysLinkToLastBuild: false,
58+
keepAll: true,
59+
reportDir: 'sonic-utilities/deb_dist/sonic-utilities-1.2/htmlcov',
60+
reportFiles: 'index.html',
61+
reportName: 'RCov Report'
62+
])
63+
64+
publishCoverage(adapters: [
65+
coberturaAdapter('sonic-utilities/deb_dist/sonic-utilities-1.2/coverage.xml')
66+
])
5467
}
68+
5569
success {
5670
archiveArtifacts(artifacts: 'sonic-utilities/deb_dist/python-sonic-utilities_1.2-1_all.deb,wheels/sonic_config_engine-1.0-py2-none-any.whl,wheels/swsssdk-2.0.1-py2-none-any.whl,wheels/sonic_py_common-1.0-py2-none-any.whl,wheels/sonic_py_common-1.0-py3-none-any.whl, sonic-swss-tests/tests/log/**')
5771
}
72+
5873
fixed {
5974
slackSend(color:'#00FF00', message: "Build job back to normal: ${env.JOB_NAME} ${env.BUILD_NUMBER} (<${env.BUILD_URL}|Open>)")
6075
office365ConnectorSend(webhookUrl: "${env.SONIC_TEAM_WEBHOOK}")
6176
}
77+
6278
regression {
6379
slackSend(color:'#FF0000', message: "Build job Regression: ${env.JOB_NAME} ${env.BUILD_NUMBER} (<${env.BUILD_URL}|Open>)")
6480
office365ConnectorSend(webhookUrl: "${env.SONIC_TEAM_WEBHOOK}")
6581
}
82+
6683
cleanup {
6784
cleanWs(disableDeferredWipeout: false, deleteDirs: true, notFailBuild: true)
6885
}

0 commit comments

Comments
 (0)