I am using SonarQube 6.5, And trying import lcov.info file for code coverage using sonar.javascript.lcov.reportPaths property.
My build is done using Jenkins. code is deployed and tested at /path/to/Deploydirectory/parent-project1/project1/ and reports are generated in jenkins workspace /path/to/jenkins/workspace/BUILD_DEPLOY/parent-project1/project1/coverage.
I am using istanbul for code coverage as
"scripts": {
"coverage": "./node_modules/.bin/istanbul cover
node_modules/mocha/bin/_mocha --dir=/path/to/jenkins/workspace/BUILD_DEPLOY/parent-project1/project1/coverage"
},
lcov.info are generated as below
TN:
SF:/path/to/Deploydirectory/project1/package/plugins/file1.js
FN:11,convetUTCtoLocal
FN:17,customCallback
FN:26,(anonymous_3)
FN:50,(anonymous_4)
FN:68,(anonymous_5)
FN:95,(anonymous_6)
......
On SonarQube getting error
Could not resolve 2 file paths in [/path/to/jenkins/workspace/BUILD_DEPLOY/parent-project1/project1/coverage/lcov.info, /path/to/jenkins/workspace/BUILD_DEPLOY/parent-project2/project2/coverage/lcov.info], first unresolved path: /path/to/Deploydirectory/parent-project1/project1/file1.js
sonrQube config
sonar.inclusions=**/*.js
sonar.scm.disabled=true
sonar.sources=$WORKSPACE
sonar.java.binaries=$WORKSPACE
sonar.projectBaseDir=/path/to
sonar.javascript.lcov.reportPaths=
/path/to/jenkins/workspace/BUILD_DEPLOY/parent-
project1/project1/coverage/lcov.info,
/path/to/jenkins/workspace/BUILD_DEPLOY/parent-
project2/project2/coverage/lcov.info
sonar.sourceEncoding=UTF-8