xUnit tests fails when executed by Azure DevOps
The problem was that the default file pattern to look for test assemblies (*test*.dll
) also did include xUnit's core assemblies (named xunit.runner.visualstudio.dotnetcore.testadapter.dll
), which confused the test system.
All I had to do to fix the issue is use a more specific pattern (like *tests.dll
), or exclude all test adapter assemblies (!**/*testadapter.dll
).
Update : The official xUnit documentation has been updated to help avoid this problem (https://xunit.net/docs/getting-test-results-in-azure-devops)