在VSTS中包括代码覆盖率报告,VSTS是否必须使用测试适配器? [英] Include code coverage report in VSTS, Is Test Adapter mandatory for VSTS?

查看:82
本文介绍了在VSTS中包括代码覆盖率报告,VSTS是否必须使用测试适配器?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Karma-coverage生成代码覆盖率.我可以将输出coverage文件夹托管在http服务器上,并在本地查看.

I am generating code coverage using Karma-coverage. I can host my output coverage folder on http-server and view it locally.

如何在VSTS代码覆盖率标签上显示此报告?

How do I make this report visible on VSTS code coverage tab?

我需要在与VSTS兼容的情况下重新格式化覆盖范围结果吗?

Do I need to re-format my coverage result in VSTS compatible?

我已经阅读了vsts-tasks,但是我不知道如何实现它.

I have read about vsts-tasks, but I have no clue how to achieve the same.

感谢您的帮助.

推荐答案

VSTS代码覆盖率支持 Karma-Coverage支持Cobertura格式.编辑

VSTS Code coverage supports the outputted code coverage results in Jacoco or Cobertura formats. Karma-Coverage supports Cobertura format. Edit your karma.config.js for

业报覆盖范围:

coverageReporter: {
  type : 'cobertura',
  ...
}

karma-remap-istanbul:

remapIstanbulReporter: {
  reports: {
    cobertura: './coverage/cobertura.xml',
    ...
  }
}

karma-remap-coverage :

karma-remap-coverage:

remapCoverageReporter: {
 cobertura: './coverage/cobertura.xml',
 ...
},

配置输出格式后,可以使用发布代码覆盖率任务将代码覆盖率数据上传到VSTS.

Once you configure the output format, you can use Publish Code Coverage task to upload code coverage data to VSTS.

这篇关于在VSTS中包括代码覆盖率报告,VSTS是否必须使用测试适配器?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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