Unable to push coverage from lcov.info due to file path mismatch

419 views
Skip to first unread message

Kishore Polisetty

unread,
Nov 1, 2017, 12:49:29 AM11/1/17
to SonarQube
Hi Team,

We use Istanbul to generate coverage report for functional tests.

Application deployed on the EC2 machine with the instrument mode. As soon we run functional tests and download the coverage report(zip format) in jenkins / local machine. Coverage zip has lcov.info. I push lcov.in to sonarqube.

I noticed that coverage numbers are not pushing to sonarqube due to file path issue.

Eg: EC2 machine file path(Same shown in lcov.info): /home/ec2-user/Service-QA/server/file.js
      Local machine file path : /Users/uname/Documents/Service-QA/server/file.js

Is there any way to skip the working directory path in sonar to read only the server files? 

Thanks,
Kishore

Stack trace:

INFO: Integration Test Coverage Sensor is started

INFO: Analysing [/Users/kishorepolisetty/Documents/SourceCode/DevCode/Service/integration_test_coverage/lcov.info]

WARN: Could not resolve 25 file paths in [/Users/kishorepolisetty/Documents/SourceCode/DevCode/Service/integration_test_coverage/lcov.info], first unresolved path: /home/ec2-user/Service-QA/server/file.js

INFO: Overall Coverage Sensor is started

INFO: Analysing [/Users/kishorepolisetty/Documents/SourceCode/DevCode/Service/integration_test_coverage/lcov.info]

WARN: Could not resolve 25 file paths in [/Users/kishorepolisetty/Documents/SourceCode/DevCode/Service/integration_test_coverage/lcov.info], first unresolved path: /home/ec2-user/Service-QA/server/file.js

INFO: Sensor JavaScript Squid Sensor (done) | time=1466ms

INFO: Sensor Zero Coverage Sensor

INFO: Sensor Zero Coverage Sensor (done) | time=34ms

INFO: Sensor Code Colorizer Sensor

INFO: Sensor Code Colorizer Sensor (done) | time=5ms

INFO: Sensor CPD Block Indexer

INFO: DefaultCpdBlockIndexer is used for js

INFO: Sensor CPD Block Indexer (done) | time=0ms

INFO: Calculating CPD for 16 files

INFO: CPD calculation finished

INFO: Analysis report generated in 152ms, dir size=269 KB

INFO: Analysis reports compressed in 123ms, zip size=102 KB

INFO: Analysis report uploaded in 1706ms

Elena Vilchik

unread,
Nov 1, 2017, 12:40:34 PM11/1/17
to SonarQube
hi,

You are supposed to generate coverage reports on the same machine where you execute analysis. Otherwise it's due to you to play around the paths.

Kishore Polisetty

unread,
Nov 11, 2017, 9:10:33 AM11/11/17
to SonarQube
Thank you Elena.

I used sed & perl commands to modify the paths and it worked.

Best
Kishore
Reply all
Reply to author
Forward
0 new messages