0.0% Coverage after Scanner successfully parses Coverage file

Must-share information (formatted with Markdown):

  • which versions are you using (SonarQube, Scanner, Plugin, and any relevant extension): sonar-scanner-cli-4.7.0.2747-windows

  • what are you trying to achieve: Unit testing code coverage to be included in SonarQube Report

  • what have you tried so far to achieve this

I am attempting to get my SonarQube report to have more than 0.0% code coverage. I have a Typescript/Javascript project running jest unit tests that I am scanning against.

I have included the sonar.javascript.lcov.reportPaths property in the my sonar-project properties file to point to the coverage report produced by jest.
I have verified with debug logs that the scanner found and parsed the file.

I have looked through every doc, forum post and stackoverflow question I could find around this topic, most are centered around adding the correct param and verifying that the scanner is parsing the file which usually resolves the issue. I can not find any posts about what to do if you added the parameter, verified the file is found and parsed yet the coverage report still says 0.0%.

Below you will find screenshots of my properties file, debug logs and scanner report.

  1. sonar-project.properties
    image

  2. scanner debug logs

  1. Scanner report

Hey there.

What version fo SonarQube are you using (information should be in the footer of your instance).

Hello!

We are using: Community Edition - Version 7.9.5 (build 38598)

Hi,

Your version is past EOL. You should upgrade to either the latest version or the current LTS at your earliest convenience. Your upgrade path is:

7.9.5 → 8.9.10 → 9.7 (last step optional)

You may find the Upgrade Guide and the LTS-to-LTS Upgrade Notes helpful. If you have questions about upgrading, feel free to open a new thread for that here.

If your error persists after upgrade, please come back to us.

Thanks so much! We are going to give this a try, much appreciated

Just wanted to circle back, upgrading our SonarQube version and it resolved the issue. Thanks so much Colin!

1 Like