xunit.runner.visualstudio
to at least one of your test projects.
install-package xunit.runner.visualstudio
Visual Studio Test
.These instructions are written for Version 2.*
of the Visual Studio Test
task.
Test selection/Test files
, point to your generated test assemblies, for example:
**\bin\$(BuildConfiguration)\**\*.tests.dll
!**\obj\**
!**\ref\**
Note: it is important to make sure the file matching pattern is valid. You may need to add additional exclusions if your chosen name pattern unintentionally matches other files in your output folder(s). testVerAssemblyVer2
must be expressed with newlines. vsts-doc issue 1580
Execution Options/Code Coverage Enabled
checkbox./InIsolation
under Execution options/Other console options
.
(This will suppress a warning otherwise generated.)After a successful build, the test results are available on the main view of the build. It should look something like this:
You no longer need to manually configure the test adapter path, because NuGet restored test adapters are automatically searched for.
Sometimes you get this error one or many times
Warning: System.AppDomainUnloadedException: Attempted to access an unloaded AppDomain. This can happen if the test(s) started a thread but did not stop it. Make sure that all the threads started by the test(s) are stopped before completion.
It is not related to Azure DevOps and does not affect the results. For more information, see xUnit Issue 490 and MS Connect.