Dotnet Test on .NET Core 1.1 in VSTS: No Test Discoverer Detected

I am using VS 2017 with the new csproj in the .NET Standard class library, trying to test the library using the .NET Core 1.1 test project using the MSTest testing environment using the dotnet test command. Work at the local level works great; when I submit the assembly to continuous integration, I get an error:

No test discoverer is registered to perform discovery of test cases.

How do I get a registered detector and my tests in VSTS?

+5
source share
2 answers

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

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

enter image description here

  • Test Result Format = VSTest
  • Test Result Files = ** / tests-log.trx
  • Merge Test Results = (checked)
  • In Control Options set Run this task to run, even if the previous task is not completed
+5
source

Refer to the following steps:

  • Create a new .Net Core test project with the MSTest testing platform, there are links to MSTest.TestAdapter and MSTest.TestFramework, which is important.
  • Add .NET Core Step (Preview) (command: restore)
  • Add .NET Core Step (Preview) (Command: Build)
  • Add .NET Core (Preview) Step (Command: test)
  • Creating a queue using the Hosted VS2017 build agent.
0
source

Source: https://habr.com/ru/post/1266988/


All Articles