1
votes

What I want: On VSTS' build dashboards I can typically see an overview of my executed test results like this:

enter image description here

What I got: I have set up a new Core 2.0 build and go with pretty much the default build configuration:

enter image description here

All tests ran: My build logs report that all tests have been executed (four here in my sample setup):

Build started, please wait... Build completed. Test run for d:\a\3\s***.Tests\bin\release\netcoreapp2.0***.Platform.Tests.dll(.NETCoreApp,Version=v2.0) Microsoft (R) Test Execution Command Line Tool Version 15.3.0-preview-20170628-02 Copyright (c) Microsoft Corporation. All rights reserved. Starting test execution, please wait... Total tests: 4. Passed: 4. Failed: 0. Skipped: 0. Test Run Successful. Test execution time: 2.7625 Seconds

My problem: The build dashboards don't show me any test result:

enter image description here

Question: What am I doing wrong?

Failed to do this:

  • I followed the advice "Enable automated tests in your build definition by adding the Visual Studio Test task." However, that didn't change a thing.
  • A similar issue has been discussed here at SO (TFS Build Test Results), but it doesn't address my specific issue.
1

1 Answers

1
votes

Specify –logger “trx” in Arguments of .NET Core Test task to generate test result and publish test result by using Publish Test Results task.

  1. Add Delete Files task (Source Folder: $(System.DefaultWorkingDirectory); Contents: **/TestResults/**)
  2. Add .NET Core Test task (Arguments: --configuration $(BuildConfiguration) --logger "trx")
  3. Add Publish Test Results task (Test result format: VSTest; Test results files: **\*.trx; Search folder: $(System.DefaultWorkingDirectory))