Skip to content

Commit

Permalink
[sonic-utilities-build-pr] Do not attempt to publish Pytest coverage …
Browse files Browse the repository at this point in the history
…for 201911 branch (sonic-net#192)

- 201911 branch does not have Pytest coverage support, so there are no coverage results to publish
- Also add 201911-branch-specific archiving logic
  • Loading branch information
jleveque authored Nov 20, 2020
1 parent b7a6c62 commit c086913
Showing 1 changed file with 23 additions and 12 deletions.
35 changes: 23 additions & 12 deletions jenkins/common/sonic-utilities-build-pr/Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -64,22 +64,33 @@ 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/htmlcov',
reportFiles: 'index.html',
reportName: 'RCov Report'
])
script {
/* 201911 branch does not generate Pytest coverage report */
if (env.ghprbTargetBranch != '201911') {
publishHTML(target: [
allowMissing: false,
alwaysLinkToLastBuild: false,
keepAll: true,
reportDir: 'sonic-utilities/htmlcov',
reportFiles: 'index.html',
reportName: 'RCov Report'
])

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

success {
archiveArtifacts(artifacts: 'sonic-utilities/dist/sonic_utilities-1.2-py2-none-any.whl,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/**')
script {
if (env.ghprbTargetBranch == '201911') {
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/**')
} else {
archiveArtifacts(artifacts: 'sonic-utilities/dist/sonic_utilities-1.2-py2-none-any.whl,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/**')
}
}
}

cleanup {
Expand Down

0 comments on commit c086913

Please sign in to comment.