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

Is there any way to see the class coverage over xml report #271

Closed
alinaeftn opened this issue Nov 1, 2022 · 5 comments
Closed

Is there any way to see the class coverage over xml report #271

alinaeftn opened this issue Nov 1, 2022 · 5 comments
Assignees
Labels
Bug Bug issue type Kover Coverage Tool S: confirmed Status: bug is reproduced or present

Comments

@alinaeftn
Copy link

Hi!

I am interested in looking to see if there is a way to display the coverage at a file level in an HTML representation from the XML report.

Right now, we are using Jacoco and Jenkins Jacoco plugin to display the coverage on each PR. This means that we can break down to classes and see an html representation of what lines are covered in a file and what are not.

Trying Kover, I found out that we can no longer see this on the XML report. The files cannot be opened to see the actual lines that are covered by tests and the ones that are not.

Is there a way to configure Kover to include an html representation in the XML report? Or can we achieve this somehow?

Also, can we integrate this with Sonarqube? Right now we are facing the same problem with lines not being displayed for coverage in Sonarqube.

Thank you!

@alinaeftn alinaeftn added Question Support request issue type S: untriaged Status: issue reported but unprocessed labels Nov 1, 2022
@shanshin
Copy link
Collaborator

shanshin commented Nov 1, 2022

Hi,
may you clarify, what kind of HTML report do you mean, which is generated by the Kover by the koverHtmlReport command, or some of the report from the Jenkins Jacoco plugin?

@shanshin shanshin added S: waiting for clarification Status: additional information required to proceed and removed S: untriaged Status: issue reported but unprocessed labels Nov 1, 2022
@alinaeftn
Copy link
Author

@shanshin , I am referring to the HTML from Kover. Let me elaborate a little bit more.

I am using the XML report for reporting coverage from Jenkins. Meaning, I am running the koverMergedReport task and use the jacocoAdapter to display the coverage.

sh './gradlew clean build koverMergedReport --parallel'
sh 'cp build/reports/kover/merged/xml/report.xml build/koverTestReport.xml'
publishCoverage adapters: [jacocoAdapter('build/reports/kover/merged/xml/report.xml')]

But when I got in Jenkins to Coverage Report -> File Coverage I cannot click on a file to see what are the lines that are covered and what are not. I cannot have a visual input about what is tested.

Is there a way to do this?

@shanshin
Copy link
Collaborator

shanshin commented Nov 2, 2022

Unfortunately, compatibility with Jenkins is not guaranteed at the moment.
It looks like the XML report has some discrepancies due to which Jenkins cannot generate the file.

Could you provide an XML report that is displayed correctly in Jenkins and a Kover report for which no file is generated?
A XML report for small test project is enough.

@shanshin shanshin added Bug Bug issue type Kover Coverage Tool S: confirmed Status: bug is reproduced or present and removed S: waiting for clarification Status: additional information required to proceed Question Support request issue type labels Nov 2, 2022
@alinaeftn
Copy link
Author

@shanshin , the reports were generated with koverMergedReport and jacocoRootReport. No change was applied to the tasks, only xml and html enablement.

So I am assuming the default settings for this are not showing the same output or maybe not in the format in which Jenkins can interpret them and show the covered lines.

@shanshin
Copy link
Collaborator

Closed as duplicate of #272

@shanshin shanshin closed this as not planned Won't fix, can't repro, duplicate, stale Jun 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Bug issue type Kover Coverage Tool S: confirmed Status: bug is reproduced or present
Projects
None yet
Development

No branches or pull requests

2 participants