Skip to content

Commit c086913

Browse files
authored
[sonic-utilities-build-pr] Do not attempt to publish Pytest coverage 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
1 parent b7a6c62 commit c086913

File tree

1 file changed

+23
-12
lines changed

1 file changed

+23
-12
lines changed

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

+23-12
Original file line numberDiff line numberDiff line change
@@ -64,22 +64,33 @@ pipeline {
6464
always {
6565
junit(allowEmptyResults: true, keepLongStdio: true, testResults: 'sonic-swss-tests/tests/tr.xml')
6666

67-
publishHTML(target: [
68-
allowMissing: false,
69-
alwaysLinkToLastBuild: false,
70-
keepAll: true,
71-
reportDir: 'sonic-utilities/htmlcov',
72-
reportFiles: 'index.html',
73-
reportName: 'RCov Report'
74-
])
67+
script {
68+
/* 201911 branch does not generate Pytest coverage report */
69+
if (env.ghprbTargetBranch != '201911') {
70+
publishHTML(target: [
71+
allowMissing: false,
72+
alwaysLinkToLastBuild: false,
73+
keepAll: true,
74+
reportDir: 'sonic-utilities/htmlcov',
75+
reportFiles: 'index.html',
76+
reportName: 'RCov Report'
77+
])
7578

76-
publishCoverage(adapters: [
77-
coberturaAdapter('sonic-utilities/coverage.xml')
78-
])
79+
publishCoverage(adapters: [
80+
coberturaAdapter('sonic-utilities/coverage.xml')
81+
])
82+
}
83+
}
7984
}
8085

8186
success {
82-
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/**')
87+
script {
88+
if (env.ghprbTargetBranch == '201911') {
89+
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/**')
90+
} else {
91+
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/**')
92+
}
93+
}
8394
}
8495

8596
cleanup {

0 commit comments

Comments
 (0)