且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

VSTS中.NET Core项目的代码覆盖率和测试结果

更新时间:2022-12-13 15:40:53

您可以将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.