Michael
Michael

Reputation: 3150

How do I set the test timeout value inside a TFSBuild MSBuild script?

I have an MSBuild script that tells TFSBuild to run my automated tests like the following:

<Project DefaultTargets="MyBuild" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0">
...
<ItemGroup>
    <TestContainer Include="$(OutDir)\Test1.dll" />
    <TestContainer Include="$(OutDir)\Test2.dll" />
    <TestContainer Include="$(OutDir)\Test3.dll" />
    ...
</ItemGroup>
...

It seems the default timeout for a test is 30 min, but none of my tests should ever take more than ~3 seconds. How do I change the timeout in the XML?

(I'm using the test framework found in Microsoft.VisualStudio.TestTools.UnitTesting)

Upvotes: 2

Views: 1310

Answers (1)

Nick Nieslanik
Nick Nieslanik

Reputation: 4458

You should use the Built-in test execution functionality in a TFS Build Definition, located on the Process tab of a Build Definition. It allows you to specify a *.testsettings file, which in turn will contain the timeouts, etc.

Upvotes: 1

Related Questions