azure-devops - VSTS : No Test Discoverer is Registered 中 .NET Core 1.1 的 Dotnet 测试

标签 azure-devops .net-core mstest vstest dotnet-cli

我将 VS 2017 与 .NET Standard 类库中的新 csproj 一起使用,尝试使用带有 dotnet test 的 MSTest 测试框架通过 .NET Core 1.1 测试项目测试该库。命令。在本地运行效果很好;当我将构建发送到持续集成时,出现错误:
No test discoverer is registered to perform discovery of test cases.
如何在 VSTS 中注册此发现者并运行我的测试?

最佳答案

这是我在 VSTS ( detailed on my blog here ) 上的构建过程

  • 添加 dotnet restore任务。
  • 然后是 dotnet build任务。
  • 添加 dotnet test带参数的任务 --no-build --logger "trx;LogFileName=tests-log.trx
  • 添加 Publish test results具有以下设置的任务

  • enter image description here
  • Test Result Format = VSTest
  • Test Result Files = **/tests-log.trx
  • Merge Test Results =(选中)
  • Control Options套装Run this task即使上一个任务失败也能运行
  • 关于azure-devops - VSTS : No Test Discoverer is Registered 中 .NET Core 1.1 的 Dotnet 测试,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43528526/

    相关文章:

    c# - 为什么代码覆盖率在检查异常时不报告测试代码中的 100% 代码覆盖率?

    reactjs - Azure React应用程序 'You do not have permission to view this directory or page'

    azure-devops - 如何处理与 Azure DevOps 中的错误相关的工作

    c# - GC.GetTotalMemory(false) 与容器内存工作集问题(Azure AKS、.NET Core 5)

    c# - 在加载上下文中加载非托管静态 dll

    c# - 测试失败时执行代码

    c# - Visual Studio 测试资源管理器无法在已编译的测试项目中运行测试

    json - VSTS JSON 变量替换与默认发布变量

    powershell - 从 VS Team Services 构建中运行的 Powershell 创建工作区

    c# - .NET Core 中的 FTP 客户端