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?
Let us now click on Run All button in Test Explorer. It will first build the code and the run the test and you will see the total time taken by the test. Let us change the test method so that we can see the output when the test fails. Let us execute the test again by clicking on the Run All button link.
The dotnet test command is used to execute unit tests in a given solution.
Luckily, dotnet test using xUnit V2 runs the tests inside of a project (or even inside a solution) in parallel by default. So at least the tests inside of a project will be started in parallel.
The dotnet command has two functions: It provides commands for working with . NET projects. For example, dotnet build builds a project. Each command defines its own options and arguments.
This is my build process on VSTS (detailed on my blog here)
dotnet restore
task.dotnet build
task.dotnet test
task with the arguments --no-build --logger "trx;LogFileName=tests-log.trx
Publish test results
task with the following settingsTest Result Format
= VSTestTest Result Files
= **/tests-log.trxMerge Test Results
= (checked)Control Options
set Run this task
to run even if a previous task has failedIf you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With