.Net Core 2.0中的代码覆盖率 [英] Code Coverage in .Net Core 2.0

查看:111
本文介绍了.Net Core 2.0中的代码覆盖率的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在.Net Core 2.0中生成代码覆盖率?

How can I generate code coverage in .Net Core 2.0?

我尝试了以下操作:

"TestPlatform\vstest.console.exe" --collect:"Code Coverage"

但我收到此错误消息:

Data collector 'Code Coverage' message: Cannot find CodeCoverage.exe.

我尝试了dotCover最新版本2017.2,可以覆盖本地计算机,但是当

I tried dotCover latest version 2017.2 which I am able to get the coverage on the local machine, but when the same is run in the TFS Build no coverage information is generated.

我不确定TFS中的NetCore Test任务何时会获得代码覆盖支持。

I am not sure when NetCore Test task in TFS will get support for code coverage.

我如何也可以在TFS中发布DotCover的结果,以使用DotCover命令行生成.Net Core的覆盖范围?

How can I publish the results from DotCover in TFS also, to use DotCover Commandline to generate the Coverage for .Net Core?

推荐答案

VSTest 任务无法运行.NET核心测试,因为它使用测试平台版本1。要运行.NET核心测试,建议使用。 NET核心任务(预览)和测试命令。

VSTest task cannot run .NET core tests as it uses the Test platform version 1. To run .NET core tests, we recommend using the .NET core task(preview) with the test command.

但是,尚不支持代码覆盖率和其他数据收集,没有代理商支持。

However, Code coverage and other data collection is not supported yet, no agent support.


我们正在解决此问题,作为此
https://github.com/Microsoft/vsts-agent/pull/1149/files 一旦修复,将更新
线程消失了,新的代理被释放了。线程
https://github.com/microsoft/vstest/issues / 579#issuecomment-324401462

源链接: VSTest任务无法在.NET Core 2.0测试项目中执行测试

这篇关于.Net Core 2.0中的代码覆盖率的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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