This is sonar properties file we are using , in the Log files I am seeing
**1:49:58** INFO: Analysing [/var/jenkins_home/workspace/build-webapp-api/repo/src/platform/custom/coverage/lcov.info]
**11:49:58** WARN: Could not resolve 4 file paths in [/var/jenkins_home/workspace/build-webapp-api/repo/src/platform/custom/coverage/lcov.info]
**11:49:58** WARN: First unresolved path: /var/jenkins_home/workspace/build-webapp-api/repo/src/platform/custom/test/cart.spec.js (Run in DEBUG mode to get full list of unresolved paths)
I think we should probably sort out your analysis parameters before we get to the coverage reports.
This property expects paths or patterns that describe paths to files. What youâve specified doesnât include the final, file part. The ** means â0-n directoriesâ. For the first two, Iâm guessing you meant: coverage/**/*.*,node_modeules/**/*.*
This assumes that coverage and node_modules exist in your project rootâŚ? For the third value, what youâve specified indicates that report.xml also exists in project rootâŚ?
This property doesnât actually exist. I guess youâre trying to make sure that your test files arenât analyzed as source code? In that case, I would recommend an addition to your list of sonar.exclusions: **/test/**/*.js
Doing that may sort out this error, since the âmissingâ file seems to actually be a test fileâŚ?
So, can you make these changes and see if the results are any better?
Thanks thatâs fixed the issue, code coverage started showing now , however we are still seeing the warn
INFO: Analysing [/var/jenkins_home/workspace/build-webapp-api/repo/src/platform/custom/coverage/lcov.info] 18:24:23 WARN: Could not resolve 4 file paths in [/var/jenkins_home/workspace/build-webapp-api/repo/src/platform/custom/coverage/lcov.info] 18:24:23 WARN: First unresolved path: /var/jenkins_home/workspace/build-webapp-api/repo/src/platform/custom/test/cart.spec.js (Run in DEBUG mode to get full list of unresolved paths)
You can turn on debug logging to see what those 4 paths are. But from the first path, it looks like your coverage report includes test coverage of testsâŚ
I would also love to know which parameter Define the amount to Lines to cover , is that the Unit Test cases written. I am new to sonarqube and would like to know more about the way the coverage works.
As I told I can see the coverage coming but only 22% is shown , I need to know why its knot covering fully. Can you suggest some good documentation to Read.
Lines to cover isnât defined by a parameter. For the files included in your coverage report, we use what the report provides. For the files omitted from your coverage report, we calculate executable lines.