Today I decided to start upgrading yo team to the .csproj project format for .NET Core. Once I had a sample project it was time to create the build definition. Visual Studio Team Services has a template to build .NET Core so I decided to start with that.
The template looked promising because it had add the required steps including running my unit tests.
However, after my build was done I did not have any test results.
After reviewing my build log I could see tests were executed.
After doing some research I realized I had to instruct the test task to write out a log file and add a task to publish the results. To have a log file generated during the test run add following argument to the test task:
With that argument in place a .trx file will be created. Now all we have to do is publish it with the Publish Test Results task.
Use the following values to configure the task.
||Publish Test Results
|Test result format
|Test results files
|Merge test results
|Test run title
|Upload test results files
Your final build should look like the image.
Now queue a new build and you should have test results.