One of the projects in my organization is not showing code coverage and we have been working to resolve this for a long time now but not able to find a solution . Please help us in resolving it . I am attaching the required information and logs below.
I notice a number of things about your analysis parameters, but let’s start with what’s most pertinent: According to the docs, the parameter name is sonar.javascript.lcov.reportPaths. javascript, not typescript. Yes, I know it’s confusing.
That will probably solve your problem, but I want to point out a few other things:
The docs say you can use a comma-delimited list of paths for sonar.tests, so you should be able to simplify this to:
sonar.tests=src/**/*.spec.ts,src/**/*test.ts
This parameter is only needed in unusual circumstances. You should drop this & start analysis from the project root directory.
You don’t seem to be specifying sonar.sources. It defaults to . (the current directory), but it would be better to be specific about what you want to analyze.
Thank you for your reply, I have made the suggested changes but still no success.
I am attaching the latest logs and the current sonar configuration below. Do let us know your inputs.
I’m seeing this: 2022-03-22T08:18:42.5410600Z WARN: Could not resolve 193 file paths in [D:\a\1\s\{Organization-Name}.VR.UI\coverage\lcov.info], first unresolved path: src\test.ts
You need to make sure the paths in your coverage report match up to the paths the scanner is seeing. Your sonar.sources configuration starts with Eurofins.VR.UI but the path in the coverage report does not.
Im getting the same issue. Sonarqube isnt showing code coverage? Please help me to resolve this.
Sonar Config
sonar.projectKey=hk-backend-evolved
sonar.projectName=hk-backend-evolved
sonar.sources=/var/lib/jenkins/workspace/Cicd
sonar.login=<token>
sonar.javascript.lcov.reportPaths=Icov.info