Cannot generate coverage report using lcov.info file

2,510 views
Skip to first unread message

priyan...@gmail.com

unread,
Dec 20, 2017, 12:49:42 AM12/20/17
to SonarQube
I am getting below mentioned warning will trying to generate coverage report in SonarQube 6.0.

WARN: Could not resolve 11 file paths in [/var/lib/jenkins/workspace/node_sonar/coverage/lcov.info], first unresolved path: /var/lib/jenkins/workspace/node_unit_test/app.js

I have used below mentioned properties:

sonar.projectKey=VelocityApp
sonar.projectName=VelocityApp
sonar.projectVersion=0.1
 
sonar.language=js
sonar.sources=config,controllers,routes,app.js
sonar.sourceEncoding=UTF-8


sonar.tests=test/appTest.js
sonar.inclusions=config,controllers,routes,app.js,test,public

sonar.dynamicAnalysis=reuseReports
sonar.javascript.lcov.reportPaths=coverage/lcov.info


Any input is greatly appreciated.

Regards,
Priyanka S

Elena Vilchik

unread,
Dec 26, 2017, 5:21:47 AM12/26/17
to SonarQube
Hello,

"sonar.sources" accepts directories, not files. You should put "." instead of root-level "app.js".
"sonar.inclusions" accepts file path patterns, so e.g. having "test" there makes no sense.

Regards,
Elena

pante...@gmail.com

unread,
Jan 19, 2018, 9:08:06 AM1/19/18
to SonarQube
Does the specific plugin (SonarJS) only works with sonar.sources=.
?

Elena Vilchik

unread,
Jan 22, 2018, 3:32:11 AM1/22/18
to pante...@gmail.com, SonarQube
What do you mean? 
All SQ plugins work with all common properties like "sonar.sources", "sonar.inclusions" and "sonar.exclusions"

--
You received this message because you are subscribed to a topic in the Google Groups "SonarQube" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/sonarqube/qczzGYIsjis/unsubscribe.
To unsubscribe from this group and all its topics, send an email to sonarqube+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/sonarqube/d1171d33-fb56-413f-806f-b3ab739b7bd3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


--

Elena Vilchik | 
SonarSource
Language Team

Pantelis Karamolegkos

unread,
Jan 22, 2018, 3:39:13 AM1/22/18
to Elena Vilchik, pante...@gmail.com, SonarQube
OK Elena thanks.

Just another question in case you could help:

If my coverage report produces and performs this coverage on files which are NOT under version control (i.e. git), will the SonarQube produce the specific report?

What I mean:

- working on a ui project consisting of `.ts` files.
- `gulp test-coverage` generates corresponding `.js` files and runs the coverage on them
- these .js files are gitignored


will this be an issue?

Many thx.



Απο: Elena Vilchik <elena....@sonarsource.com>
Προς: pante...@gmail.com
Κοιν.: SonarQube <sona...@googlegroups.com>
Στάλθηκε: 10:32 π.μ. Δευτέρα, 22 Ιανουαρίου 2018
Θέμα: Re: Cannot generate coverage report using lcov.info file

Elena Vilchik

unread,
Jan 22, 2018, 3:46:48 AM1/22/18
to Pantelis Karamolegkos, pante...@gmail.com, SonarQube
If these "js" files are analyzed by SQ (while they should not, as they are generated files and there is no point in analyzing them), report will be imported properly.

You should try to find some way to generate report directly on TS files.
Reply all
Reply to author
Forward
0 new messages