Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Cobertura source lines report #2938

Merged
merged 1 commit into from
Jul 11, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion jenkins/Pipeline.gy
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ pipeline {
stages {
stage('Linting & Unit Tests') {
steps {
// If there is somehow a symlink left over from a previous run's
// Cobertura processing, remove it, because it seems to confuse
// the coverage data collection.
sh 'rm -fv pbench'

echo 'Linting, pytest-based unit tests, and legacy unit tests'
sh 'jenkins/run tox'
}
Expand All @@ -25,6 +30,14 @@ pipeline {
}
post {
success {
// This symlink somehow allows the Cobertura plug-in to find the
// sources referenced in the coverage report. However, the presence
// of this link inside the container seems to confuse the coverage
// data collection, so we create it here and then remove it after
// generating the report. (We use the -f option just in case there's
// an old one hanging around.)
sh 'ln -sTf lib/pbench pbench'

// Note that jenkins/run-pytests is executed inside the container
// while the Cobertura plug-in is executed natively, so this poses
// a challenge in terms of finding the coverage report file; we
Expand All @@ -41,7 +54,7 @@ pipeline {
onlyStable: false,
sourceEncoding: 'ASCII',
zoomCoverageChart: false])
sh 'rm cov/report.xml'
sh 'rm cov/report.xml pbench'
}
}
}