Code Coverage not found

Hey there. I’m completely new to this topic. my sonar always showing a message

No coverage report can be found with sonar.coverage.jacoco.xmlReportPaths=‘build/reports/jacoco/jacocoTestDebugUnitTestReport/jacocoTestDebugUnitTestReport’. Using default locations: target/site/jacoco/jacoco.xml,target/site/jacoco-it/jacoco.xml,build/reports/jacoco/test/jacocoTestReport.xml

I can assure it, the file exist.filetree

here’s my sonar setting on top level gradle.build file

is there anything wrong with my settings?

1 Like

Hi,

Welcome to the community!

Your log snippet

Doesn’t quite match what I see in your file system screenshot, which looks like:

build/reports/jacoco/jacocoTestDebugUnitTestReport/jacocoTestDebugUnitTestReport.xml

(Note the addition of .xml at the end.)

At the same time, your properties screenshot does show the ‘.xml’ at the end, in addition to “mssbase” at the beginning. It’s not clear to me whether mssbase is your project root (and so relative report paths should not include it) or a directory in your project. Given your sonar.binaries value, I guess it’s a subdirectory?

(As a side note, sonar.language had been deprecated for years, and is now no longer recognized.)

 
Ann

Thank you for responding.
Yes, it’s a subdirectory. my project is actually a multi module. so I include the “mssbase” path. as for “.xml” extension, i did include it. but the error message said the same. I just use an old screenshot.

No coverage report can be found with sonar.coverage.jacoco.xmlReportPaths=‘build/reports/jacoco/jacocoTestDebugUnitTestReport/jacocoTestDebugUnitTestReport.xml

I solved it. i just added ${project.projectDir} in front of /mssbase/build/ so it will read as absolute path.

property “sonar.coverage.jacoco.xmlReportPaths”,
“${project.projectDir}/mssbase/build/and so on …”

for now, this is the solution I’m looking for.

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.