Coverage on Sonarqube different from lcov.info report

Using SonarScanner 4.3.0.2102
SonarQube is deployed through docker

I have been writing code for my new PR, our project has a Jenkins pipeline set up running everything that is needed, my coverage report is different between the lcov report generated on the jenkins pod and sonarqube. I see new lines showing up as uncovered, but the report shows them as covered for me. I can see in the logs that the lcov.info files are being analyzed. I have a file that has a 100% coverage in the lcov coverage report but it still shows as having 4 lines uncovered in sonarqube. Can anyone help on this?

Hi,

Welcome to the community!

First, your scanner is outdated. You should upgrade to the latest version, currently 5.0.1.

Regarding your coverage, when you provide a coverage report, we go exactly by the report for the files that are listed in it, so it’s odd that you would see a discrepancy. Could you provide a screenshot of the uncovered lines in SonarQube?

 
Ann

Hello,
Thank you for the reply. My company has the sonarqube scanner set up so upgrading currently is not in the agenda.
Providing screenshots also would not be possible as it is not on public code, We have unit test being written in mocha and chai and e2e testing done using cypress, I’m finding that sonarqube picks up the lines covered or uncovered from the e2e coverage, those match but even if those same lines are being covered in unit tests those are somehow not being shown as covered. Any ideas on this, I can see that we are providing both the coverage reports for the sonar scanner.

Thank you !

Hi,

I’m at a dead end. I can’t see what you’re talking about (you could blur out the code itself…) and I can only tell you that we go 100% by what’s in the coverage reports you include in analysis.

 
Ann