jlo-gmail
jlo-gmail

Reputation: 5048

TFS Visual Studio Test task "No results found to publish." when setting "Override TestRun Parameters"

I have a VS 2017 unit tests with a runsettings file.

  <TestRunParameters>
    <Parameter name="Url" value="http://dev-foo-app:8080/tws/service/foowebservices/" />
    <Parameter name="Fileset" value="O" />
    <Parameter name="Loop" value="1" />
  </TestRunParameters>

In the Visual Studio Test task I set Loop=10 in Override TestRun Parameters . After the build runs, I look at the Tests tab and see: No test runs available for this build. Enable automated tests in your Build Definition by adding the Visual Studio Test Task

If I leave Override TestRun Parameters empty, I can see all the tests that run in the Tests tab.

Test Task Log:

Executing the powershell script: D:\TfsBuildAgents\VsoBuildAgent\tasks\VSTest\1.0.32\VSTest.ps1
##[debug]Calling Invoke-VSTest for all test assemblies
Working folder: D:\TfsData\Build\CamsPool\vsoAgent\_work\69
Executing C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\CommonExtensions\Microsoft\TestWindow\vstest.console.exe "D:\TfsData\Build\CamsPool\vsoAgent\_work\69\s\TWS.Test\foo Web Services\Tws.Test\bin\Release\Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.dll" "D:\TfsData\Build\CamsPool\vsoAgent\_work\69\s\TWS.Test\foo Web Services\Tws.Test\bin\Release\Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.dll" "D:\TfsData\Build\CamsPool\vsoAgent\_work\69\s\TWS.Test\foo Web Services\Tws.Test\bin\Release\Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.Interface.dll" "D:\TfsData\Build\CamsPool\vsoAgent\_work\69\s\TWS.Test\foo Web Services\Tws.Test\bin\Release\Microsoft.VisualStudio.TestPlatform.TestFramework.dll" "D:\TfsData\Build\CamsPool\vsoAgent\_work\69\s\TWS.Test\foo Web Services\Tws.Test\bin\Release\Microsoft.VisualStudio.TestPlatform.TestFramework.Extensions.dll" "D:\TfsData\Build\CamsPool\vsoAgent\_work\69\s\TWS.Test\foo Web Services\Tws.Test\bin\Release\Tws.Test.dll"  /Settings:"D:\TfsData\Build\CamsPool\vsoAgent\_work\69\TestResults\test_2017-08-30_12-22-00-AM.runsettings" /logger:trx /TestAdapterPath:"D:\TfsData\Build\CamsPool\vsoAgent\_work\69\s"
Microsoft (R) Test Execution Command Line Tool Version 14.0.23107.0
Copyright (c) Microsoft Corporation.  All rights reserved.
Starting test execution, please wait...
Warning: Input string was not in a correct format. 
Warning: Input string was not in a correct format.
Passed   , 
Results File: D:\TfsData\Build\CamsPool\vsoAgent\_work\69\TestResults\TestResults\tfsbuild_foo-TFS-APP1 2017-08-30 00_22_03.trx
Total tests: 11. Passed: 11. Failed: 0. Skipped: 0.
Test Run Successful.
Test execution time: 16.2318 Seconds
##[warning]No results found to publish.

Upvotes: 0

Views: 809

Answers (1)

jlo-gmail
jlo-gmail

Reputation: 5048

This is a pretty annoying work-around:

In *.runsettings file change:

<ResultsDirectory>.\TestResults</ResultsDirectory>

to

 <ResultsDirectory></ResultsDirectory>

In my case, this means I must set a value for all instances of my build. If you omit Override TestRun Parameters, the test task will fail differently -- and for no apparent reason.

Upvotes: 0

Related Questions