5

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?

Dagrooms
  • 1,507
  • 2
  • 16
  • 42

2 Answers2

5

This is my build process on VSTS (detailed on my blog here)

  1. Add a dotnet restore task.
  2. Then a dotnet build task.
  3. Add a dotnet test task with the arguments --no-build --logger "trx;LogFileName=tests-log.trx
  4. Add a Publish test results task with the following settings

enter image description here

  1. Test Result Format = VSTest
  2. Test Result Files = **/tests-log.trx
  3. Merge Test Results = (checked)
  4. In Control Options set Run this task to run even if a previous task has failed
Peter Morris
  • 20,174
  • 9
  • 81
  • 146
0

Refer to these steps below:

  1. Create a new .Net Core test project with MSTest testing framework, there are MSTest.TestAdapter and MSTest.TestFramework package references, which is importance
  2. Add .NET Core (Preview) step (Command: restore)
  3. Add .NET Core (Preview) step (Command: build)
  4. Add .NET Core (Preview) step (Command: test)
  5. Queue build with Hosted VS2017 build agent.
starian chen-MSFT
  • 33,174
  • 2
  • 29
  • 53
  • This is exactly how my build was set up when getting this error – Dagrooms Apr 21 '17 at 15:57
  • @Dagrooms Do you use Hosted VS2017 build agent? What's the detail build log? Can you reproduce that issue with a new project? You can share a simple project on the OneDrive. – starian chen-MSFT Apr 24 '17 at 01:42