VSTS 中 .NET Core 1.1 上的 Dotnet 测试:未注册测试发现者 [英] Dotnet test on .NET Core 1.1 in VSTS: No Test Discoverer is Registered
问题描述
我在 .NET Standard 类库中使用 VS 2017 和新的 csproj,尝试使用带有 dotnet test
命令的 MSTest 测试框架通过 .NET Core 1.1 测试项目测试库.在本地运行效果很好;当我将构建发送到持续集成时,出现错误:
没有注册测试发现者来执行测试用例的发现.
如何在 VSTS 中注册此发现者并运行我的测试?
这是我在 VSTS 上的构建过程 (
测试结果格式
= VSTest测试结果文件
= **/tests-log.trx合并测试结果
=(选中)- 在
Control Options
中设置Run this task
即使上一个任务失败也运行
I'm using VS 2017 with the new csproj in a .NET Standard class library, trying to test the library with a .NET Core 1.1 test project using MSTest testing framework with the dotnet test
command. Running locally works perfectly fine; when I send the build to continuous integration, I get the error:
No test discoverer is registered to perform discovery of test cases.
How do I get this discoverer registered, and my tests running, in VSTS?
This is my build process on VSTS (detailed on my blog here)
- Add a
dotnet restore
task. - Then a
dotnet build
task. - Add a
dotnet test
task with the arguments--no-build --logger "trx;LogFileName=tests-log.trx
- Add a
Publish test results
task with the following settings
Test Result Format
= VSTestTest Result Files
= **/tests-log.trxMerge Test Results
= (checked)- In
Control Options
setRun this task
to run even if a previous task has failed
这篇关于VSTS 中 .NET Core 1.1 上的 Dotnet 测试:未注册测试发现者的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!