Search code examples
unit-testingazure-devopstfsbuild.net-corenunit-3.0

Unable to publish nunit test results to Visual Studio Team Services


I'm setting up Continuous integration in Team Services. The solution currently has a couple of unit test projects. All projects in the solution are .NET core projects.

The out of the box test runner in the build definition isn't pick up any of the unit tests projects (yes, the test assembly wildcards are setup correctly), so I've resorted to writing a batch file that executes dotnet test. After the command runs, an XML file is written to the disk which contains the results. I'm using the publish results step and pointing to that file so that the test results will show up in the build output. I've set the "Test Result Format" field to NUnit, but that step produces the following warning:

Invalid results file. Please make sure the Test Result Format field in the task matches the result format of the file: C:\<path to file>\TestResult.xml

Has anyone else been able to publish NUnit test results that were generated from running the dotnet test command in Team Services?


Solution

  • This is because VSTS does not support NUnit3 format. You can consider to use the workarounds mentioned by jirisykora83 and CharliePoole in this question: Support NUnit2 format.