VSTS中.NET Core项目的代码覆盖率和测试结果 [英] Code coverage and test results for .NET Core projects in VSTS

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

问题描述

我们如何在VSTS中启用.NET Core项目的代码覆盖和测试结果?

How do we enable code coverage and test results for .NET Core projects in VSTS?

当前,.NET Core测试任务未启用它.

Currently, it is not enabled for a .NET Core test task.

推荐答案

您可以将Visual Studio Test任务与/framework一起使用:.NETCoreApp,Version = v1.1"选项来运行.NET Core测试. (在Visual Studio测试任务中指定vstest.console.exe路径:C:\ Program Files(x86)\ Microsoft Visual Studio \ 2017 \ Enterprise \ Common7 \ IDE \ Extensions \ TestPlatform)

You can use Visual Studio Test task with /framework:".NETCoreApp,Version=v1.1" option to run .NET Core tests. (Specify vstest.console.exe path in a Visual Studio Test task: C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\Extensions\TestPlatform)

有关代码覆盖率的文章: 使用代码覆盖率 .

An article about code coverage: Working with Code Coverage.

但是上传覆盖文件时存在问题: 发布VSTest:正在跳过附件,因为它超出了最大允许大小或磁盘上不可用 .

But there is the issue when uploading a coverage file: Publish VSTest: Skipping attachment as it exceeded the maximum allowed size or not available on disk.

另一方面,您可能会得到一个空结果生成的问题:.

On the other hand, you may get an empty-result-generated issue: Running code coverage from Visual Studio 2017 always results in "Empty results generated: No binaries were instrumented..".

最后,您可以跟踪这些问题的更新,并在问题解决后重试.

To conclude, you can track the update of these issues, and try again after the issues have been fixed.

这篇关于VSTS中.NET Core项目的代码覆盖率和测试结果的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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