VSTS Configuration to run xUnit tests for x64 plat

2019-07-25 01:32发布

问题:

I need to make configuration for run xUnit test that build only for x64 platform. How can I do that?

I found this article but it doesn't help. I've got

No test runs are available for this build.

Here are my properties in VSTS:

Test assemblies: **\*test*.dll  !**\obj\**
Search folder: src/Modules
Test platform version: Visual Studio 2017
Build platform: x64
Build configuration: Release

回答1:

Refer to these steps:

  1. Change BuildPlatform variable to x64
  2. NuGet restore
  3. Build solution (Platform: $(BuildPlatform); Configuration: $(BuildConfiguration); Visual Studio Version: Visual Studio 2017)

  4. .Net Core (Preview) (Command: test; Projects: **/*Test*.csproj; Arguments: --configuration $(BuildConfiguration) --logger "trx;LogFileName=TEST-results.xml" /property:Platform=$(BuildPlatform))

  5. Publish Test Results (Test Result Format: VSTest; Test Results Files: **/TEST-*.xml)