Skip to content
This repository has been archived by the owner on Oct 29, 2024. It is now read-only.

Getting coverage information in Jenkinsfile pipeline #257

Open
aadis opened this issue Jun 27, 2018 · 1 comment
Open

Getting coverage information in Jenkinsfile pipeline #257

aadis opened this issue Jun 27, 2018 · 1 comment

Comments

@aadis
Copy link

aadis commented Jun 27, 2018

Has anyone gotten coverage information out from Jenkinsfile? I always get this:

[Cobertura] Publishing Cobertura coverage report...
[Cobertura] Publishing Cobertura coverage results...
[Cobertura] Cobertura coverage report found.

but after that

[phabricator:process-build-result] No line coverage found, skipping...
[phabricator:process-build-result] No coverage provider available.
[phabricator:file-fetcher] no files found by path: '.phabricator-lint'
[phabricator:harbormaster] Sending Harbormaster RUN_DISPLAY_URL via PHID: PHID-HMBT-5fmffgo4b7rm5de5nie6
[phabricator:process-build-result] Publishing unit results to Harbormaster for 162 tests.
[phabricator:process-build-result] Sending build result to Harbormaster with PHID PHID-HMBT-5fmffgo4b7rm5de5nie6, success: false

I'm calling cobertura like

step([$class: 'CoberturaPublisher', autoUpdateHealth: true, autoUpdateStability: true, coberturaReportFile: '**/coverage*.xml',
               failNoReports: false, failUnhealthy: false, failUnstable: false, maxNumberOfBuilds: 3, onlyStable: false, zoomCoverageChart: true])
publishHTML([allowMissing: true, keepAll: true, reportDir: 'htmlcov', reportFiles: 'index.html', reportName: 'Python Coverage HTML'])

and Phabricator plugin like

step([$class: 'PhabricatorNotifier', commentOnSuccess: true, commentWithConsoleLinkOnFailure: true, uberallsEnabled:true,
             customComment:true, commentFile:".phabricator-comment", commentSize:"20000",
             processLint:true, lintFile:".phabricator-lint",  ])

Any ideas what I'm doing wrong?

@arcadien
Copy link

arcadien commented Aug 1, 2019

I am producing a report named coverage-cobertura.xml using lcov+lcov_cobertura.
Now phabricator-jenkins-plugin can see there is a Cobertura result, but does not process it:

14:53:23  [phabricator:uberalls] Using coverage metrics from Cobertura Jenkins Plugin
14:53:23  [phabricator:process-build-result] No line coverage available to post to Harbormaster.
14:53:23  [phabricator:harbormaster] Sending Harbormaster BUILD_URL via PHID: PHID-HMBT-3igswi54yvbltbttvold
14:53:24  [phabricator:process-build-result] Publishing unit results to Harbormaster for 8 tests.
14:53:24  [phabricator:process-build-result] Sending build result to Harbormaster with PHID PHID-HMBT-3igswi54yvbltbttvold, success: true
14:53:25  [phabricator:file-fetcher] no file configured

I think you have to rename your coverage file to coverage-xxx.xml, it not the case. The pattern of file is hardcoded in the plugin code.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants