我们如何在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.
另一方面,您可能会得到一个空结果生成的问题:从Visual Studio 2017运行代码覆盖始终会导致生成了空结果:未检测到二进制文件." .
On the other hand, you may get an empty-result-generated issue: Running code coverage from VisualStudio2017 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项目的代码覆盖率和测试结果
发布评论