Skip to content

Commit

Permalink
[sonic-utilities]: add code coverage report
Browse files Browse the repository at this point in the history
Signed-off-by: Guohan Lu <lguohan@gmail.com>
  • Loading branch information
lguohan committed Aug 9, 2020
1 parent b045352 commit 76b62b0
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 0 deletions.
14 changes: 14 additions & 0 deletions jenkins/common/sonic-utilities-build-pr/Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,21 @@ pipeline {

always {
junit(allowEmptyResults: true, keepLongStdio: true, testResults: 'sonic-swss-tests/tests/tr.xml')

publishHTML(target: [
allowMissing: false,
alwaysLinkToLastBuild: false,
keepAll: true,
reportDir: 'sonic-utilities/deb_dist/sonic-utilities-1.2/htmlcov',
reportFiles: 'index.html',
reportName: 'RCov Report'
])

publishCoverage(adapters: [
coberturaAdapter('sonic-utilities/deb_dist/sonic-utilities-1.2/coverage.xml')
])
}

success {
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/**')
}
Expand Down
17 changes: 17 additions & 0 deletions jenkins/common/sonic-utilities-build/Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -51,18 +51,35 @@ pipeline {
post {
always {
junit(allowEmptyResults: true, keepLongStdio: true, testResults: 'sonic-swss-tests/tests/tr.xml')

publishHTML(target: [
allowMissing: false,
alwaysLinkToLastBuild: false,
keepAll: true,
reportDir: 'sonic-utilities/deb_dist/sonic-utilities-1.2/htmlcov',
reportFiles: 'index.html',
reportName: 'RCov Report'
])

publishCoverage(adapters: [
coberturaAdapter('sonic-utilities/deb_dist/sonic-utilities-1.2/coverage.xml')
])
}

success {
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/**')
}

fixed {
slackSend(color:'#00FF00', message: "Build job back to normal: ${env.JOB_NAME} ${env.BUILD_NUMBER} (<${env.BUILD_URL}|Open>)")
office365ConnectorSend(webhookUrl: "${env.SONIC_TEAM_WEBHOOK}")
}

regression {
slackSend(color:'#FF0000', message: "Build job Regression: ${env.JOB_NAME} ${env.BUILD_NUMBER} (<${env.BUILD_URL}|Open>)")
office365ConnectorSend(webhookUrl: "${env.SONIC_TEAM_WEBHOOK}")
}

cleanup {
cleanWs(disableDeferredWipeout: false, deleteDirs: true, notFailBuild: true)
}
Expand Down

0 comments on commit 76b62b0

Please sign in to comment.