LCOV.INFO 有 SF 的绝对路径 [英] LCOV.INFO has absolute path for SF

查看:27
本文介绍了LCOV.INFO 有 SF 的绝对路径的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要在业力覆盖生成的 lcov.info 文件中将相对路径作为 SF: 参数的值.这是为了使 SonarQube 能够收集信息以显示覆盖范围.目前,SF 参数具有完整的绝对路径,例如c:abcxyz....srcarfoo.js

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:abcxyz....srcarfoo.js

我需要SF:srcarfoo.js

I need to have SF: srcarfoo.js

有没有办法做到这一点?

Is there a way to achieve this?

推荐答案

不幸的是,仍然不可能开箱即用.要解决此问题,您可以:

Unfortunately it is still impossible out of the box. To fix the issue you can either:

  • 使用与 this 请求合并的 istanbul,
  • 使用sed(示例)等工具处理输出文件,
  • 从执行声纳扫描的同一台机器生成报告(原始建议).
  • 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).

这篇关于LCOV.INFO 有 SF 的绝对路径的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆