I have an Angular project with some tests. My build is written in Gulp. I run the tests using Karma and produce an lcov report.
I then use the gulp-sonar plugin to run Sonar. My sonar config looks like this:
"sonar": {
"host": {
"url": "http://mysonar.example.com.au"
},
"projectKey": "sonar:advertising-test",
"projectName": "advertising-test",
"projectVersion": "1.0.0",
"sources": "app/js",
"javascript": {
"lcov": {
"reportPath": "reports/coverage/lcov.info"
}
},
"exec": {
"maxBuffer": "1048576"
}
}
Sonar runs and analyses the code but it fails when trying to read the lcov report with the following:
[09:38:58] 09:38:58.322 WARN - Problem during processing LCOV report: can't save DA data for line 0.
java.lang.IllegalArgumentException: Line with number 0 doesn't belong to file app/js/main.js
...
[09:38:58] 09:38:58.324 WARN - Problem during processing LCOV report: can't save DA data for line 65.
java.lang.IllegalArgumentException: Line with number 65 doesn't belong to file app/js/constants.js
and so on for pretty much every js file i have.
If i produce an html coverage report then the report looks fine so it seems the report is being correctly generated.
I wonder if this is caused by the karma-browserify step that I use.
Can someone help with my lcov report errors?
Has any one managed to get lcov coverage reports working with karma and browserify?