jenkinsci / code-coverage-api-plugin

Deprecated Jenkins Code Coverage Plugin
https://plugins.jenkins.io/code-coverage-api/
MIT License
111 stars 77 forks source link

Jenkins UI is not displaying both JaCoCo and Cobertura code coverage report #753

Closed ananta-code closed 1 year ago

ananta-code commented 1 year ago

Jenkins and plugins versions report

Environment ```text We are using jenkins Version 2.414.1 Code Coverage API plugin version 4.7.0 ``` We have an application which has Java and C++ code and we are generating code coverage report for both Java and c++. but surprisingly only the 2nd report is getting displayed in jenkins UI.
image

Jenkins

What Operating System are you using (both controller, and any agents involved in the problem)?

CentOs 7 for both Controller and agent

Reproduction steps

Create an application having java and C++ modules and generate code coverage for both java and c++

Expected Results

Both C++ and Java reports should be generated but with the latest jenkins and code coverage Api plugin still only 1 report is getting displayed in jenkins UI and another one is empty.

Actual Results

Only 2nd report is displaying correctly and first report is empty specified in the attached screenshot

Anything else?

Only 2nd report is displaying correctly and first report is empty specified in the attached screenshots

uhafner commented 1 year ago

From the screenshot it looks like you are using the deprecated step. Can you please upgrade your script, see https://plugins.jenkins.io/code-coverage-api/#plugin-content-pipeline-example for an example.

ananta-code commented 1 year ago

@uhafner we are using below code for java. publishCoverage adapters: [jacocoAdapter('ci-testlogs/**/jacoco.xml')] and for Cobertura we are using the below.

cobertura(autoUpdateHealth: false, autoUpdateStability: false, coberturaReportFile: codeCoverageFile,
                        conditionalCoverageTargets: '70, 0, 0', failNoReports: false, failUnhealthy: false, failUnstable: false,
                        lineCoverageTargets: '80, 0, 0', maxNumberOfBuilds: 0, methodCoverageTargets: '80, 0, 0', onlyStable: false,
                        sourceEncoding: 'ASCII', zoomCoverageChart: false)

Could you please tell what i have to use ? and also what is the plugin version it needs.

uhafner commented 1 year ago

Did you have a look in the README? I linked that in my comment.

uhafner commented 1 year ago

Full documentation: https://www.jenkins.io/doc/pipeline/steps/code-coverage-api/