user3167162
user3167162

Reputation: 495

Visual Studio Team Services Test Agent not using ResultsDirectory in .runsettings file

We want to configure the Test Run directory paths when running unit tests in the 'Visual Studio Test using Test Agent' build task.

The task uses a .runsettings file:

<RunSettings> 
<RunConfiguration> 
    <ResultsDirectory>C:\TestRuns</ResultsDirectory>
    <TargetPlatform>x64</TargetPlatform>
<TargetFrameworkVersion>Framework45</TargetFrameworkVersion> 
</RunConfiguration>
</RunSettings>

We expect Test Runs to use the C:\TestRuns directory however it uses the %Temp% directory instead which results in the 260 path limit being exceeded.

It looks like the .runsettings file was used based on the fact that setting the TargetPlatform to 'x64' was apparently effective. Also, using the same .runsettings locally in Visual Studio configured the directories as expected to 'C:\TestRuns'.

Is there something missing to be configured on the Test Agent or task?

Update: Microsoft responded on their github repository that it is currently not possible to configure the test run directories in the build configuration. However it is possible to modify them using the TestContext object during Unit Tests.

Upvotes: 1

Views: 602

Answers (1)

jessehouwing
jessehouwing

Reputation: 114887

One can override the TestRun directory by passing an additionaltest run parameter to the Test Runner task:

Override TestRun Parameters: "ResultsDirectory=C:\TestResults"

Upvotes: 1

Related Questions