问题
I need to have relative path as value of SF: parameter in the lcov.info file generated by karma coverage. This is to enable SonarQube to gather the info to display the coverage. Currently, the SF parameter is having complete absolute path , e.g. c:\abc\xyz....\src\bar\foo.js
I need to have SF: src\bar\foo.js
Is there a way to achieve this?
回答1:
Unfortunately it is still impossible out of the box. To fix the issue you can either:
- use istanbul merged with this request,
- process the output file using tools like
sed
(example), - generate the report from the same machine that Sonar scanning is performed (original advice).
来源:https://stackoverflow.com/questions/45602358/lcov-info-has-absolute-path-for-sf