We have multi module project and having multiple LCOV. After scanning we are not getting correct coverage. I analysed LCOV report on https://lcov-viewer.netlify.app/ but sonar is not producing coverage inline to lcov-viewer display.
Workclient/target is a parent directorory and coverage-report and coverage-date are child directories of target directory. -----> are child directories of coverage-date which contains lcov.info respectively.
Given this structure. we are not getting coverage data on sonar inline to what Lcov.info file produced the result
However, jenkins build logs implies that all above given locv.info files analylsed successfully.
Not sure how to fix those paths as lcove.info files are being found correctly from the given path. I also tried with avoiding wildcard and provided absolute patch of each lcov file comma separated.
Are you moving the lcov files around after creation? If so, it may be that that’s what’s throwing it off. Otherwise, you may need to add a step to adjust the paths in the reports.
We are doining sonar scan in post action in CI(Jenkins) pipeline and all reports generate under workclien/target directory at run time in jenkins agents and we provide the path of each lcov in pom (as mentioned in earlier post)
From the analysis base directory, where does ../local/js/browser... get you?
Again, you need to look at the paths in the reports and compare them to the paths analysis is seeing. Probably the paths in the reports should be relative from the project / analysis base directory.
It looks like this blog explaing our issue but just wanted to know is this blog still relevant being it was published in 2018?
What we have noticed it that in one of the modules model-runner we are doing coverage on only one directory model-runner/libs and sonar producing correct coverage 74% uder code section which is inline to lcov.info but overall coverage (on overview page) to this module is dropping to just 24.1%. Does that mean sonar is generating overall coverage to all the directories/files that reside under model-runner and not only on model-runner/libs directory?