Azure-pipelines-tasks: Test Agent not using ResultsDirectory in .runsettings file

Created on 10 Feb 2016  Â·  8Comments  Â·  Source: microsoft/azure-pipelines-tasks

We're using a .runsettings file with the 'Visual Studio Test using Test Agent' build task:

<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 is using the %Temp% directory instead.

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?

Most helpful comment

This behavior is by design.

That response makes no sense. There's a property called ResultsDirectory and it's documented as being where the test results go. Therefore it cannot be "by design" that they go somewhere else.

Any specific reason why you are interested in having a specific results directory location?

This sort of question is so annoying ... there are numerous well-known reasons why people want to keep generated files out of their source folders.

All 8 comments

Hi TestO2015,
This behavior is by design.
Any specific reason why you are interested in having a specific results directory location?

Thanks AshwiniChalla,

The reason is that when the %TEMP% directory is used the the 260 character path limit is exceeded.

We were able to work around this for most of the Test Run directories by changing them using the TestContext object during TestInitialize. What remains is the TestContext.DeploymentDirectory as it is created before the TestInitialize. We could work around this too but it's a little messy.

Is there another way we can configure the Test Runs directories? Also, would be interested to know the reason behind the design!

There is no other way to configure the test run directories as of today.
We will look to fix this. Added to our backlog.

I was able to set the Results directory by adding an "Override TestRun Parameters" to "ResultsDirectory=.\TestResults". This created the TestResults directory in the directory above the Build_SourcesDirectory.

MattHanMS, did you achieve this using the "Run Functional Tests" task, or the "Visual Studio Test" task? Was this with TFS 2015 Update 2?

This was using the ‘Visual Studio Task’. I believe it was with TFS 2015 Update 2, but can’t confirm.

From: Chris Breitner [mailto:[email protected]]
Sent: Friday, June 16, 2017 2:40 PM
To: Microsoft/vsts-tasks vsts-tasks@noreply.github.com
Cc: Matt Hanson matthan@xbox.com; Comment comment@noreply.github.com
Subject: Re: [Microsoft/vsts-tasks] Test Agent not using ResultsDirectory in .runsettings file (#1207)

MattHanMS, did you achieve this using the "Run Functional Tests" task, or the "Visual Studio Test" task? Was this with TFS 2015 Update 2?

—
You are receiving this because you commented.
Reply to this email directly, view it on GitHubhttps://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2FMicrosoft%2Fvsts-tasks%2Fissues%2F1207%23issuecomment-309140346&data=02%7C01%7Cmatthan%40xbox.com%7C4581a4ce2c4646d6b04f08d4b5003dc3%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C636332460038151241&sdata=jXsneEUVe%2FTKF9g0bH4EhBYFtpjHJM14ne8TAKc7H60%3D&reserved=0, or mute the threadhttps://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAQxBETnofVwv6Qmh5RuRcWTDvg1pCakgks5sEvYvgaJpZM4HXFW7&data=02%7C01%7Cmatthan%40xbox.com%7C4581a4ce2c4646d6b04f08d4b5003dc3%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C636332460038151241&sdata=NwCEnyR2ZuRMITDIZz6eIk4TfG6ZfuBQUVr7iDOorek%3D&reserved=0.

This behavior is by design.

That response makes no sense. There's a property called ResultsDirectory and it's documented as being where the test results go. Therefore it cannot be "by design" that they go somewhere else.

Any specific reason why you are interested in having a specific results directory location?

This sort of question is so annoying ... there are numerous well-known reasons why people want to keep generated files out of their source folders.

I was able to set the Results directory by adding an "Override TestRun Parameters" to "ResultsDirectory=.\TestResults". This created the TestResults directory in the directory above the Build_SourcesDirectory.

I'm not sure how this could possibly work.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

MichaelWhiteCodingForFun picture MichaelWhiteCodingForFun  Â·  3Comments

divyesh-parikh picture divyesh-parikh  Â·  3Comments

ThomasBarnekow picture ThomasBarnekow  Â·  3Comments

montebhoover picture montebhoover  Â·  3Comments

timfish picture timfish  Â·  3Comments