Code Coverage showing 0 in Sonarqube Portal

For my Nodejs application for Unit Testing I have used Mocha + Chai. And for code coverage I have used nyc as tool. I have generated coverage report by nyc locally. It is working fine. The reports generated as lcov format as suggested. But after uploading the coverage folder into server and setting up the path properly in sonarqube configuration still it is showing 0 percentage. (sonarqube set in the build pipeline).

What is missing from my end. Is nyc supported by SonarQube.

Hey there.

LCOV reports are supported by SonarQube.

What do the logs say?

Hey Colin,

Sorry for late reply. Thanks for your reply. I have checked the log. It seems to have path problem to detect lcov.info. Setting the proper path fix the matter. Now I can see the coverage percentage.

Thank you

1 Like