Multiple Test Runs in one BuildType

If you are using TeamBuild then this post is for you. 

In TeamExplorer when you create a new build type it will create a *.proj file. During the creation of this build type, you will be asked which TestLists you would like executed in that build type. Once completed if you open that proj file, you will see an item group that looks something like the following:

<ItemGroup>
<MetaDataFile Include="$(SolutionRoot)\TestProject1\TestProject1.vsmdi">
<TestList>TestList1;TestList2</TestList>
</MetaDataFile>
</ItemGroup>

For this build type there are actually 2 different TestLists, TestList1 and TestList2. These TestLists will get executed and reported on in the build. With the out of box ItemGroup configuration both lists will actually roll up into one set of test results; but what if you wanted to to actually have multiple test runs for a given build. 

We can make a very slight modification to that generated code block and actually get a separate test run per test list.

<PropertyGroup>
<VsmdiPath>$(SolutionRoot)\TestProject1\TestProject1.vsmdi</VsmdiPath>
</PropertyGroup>

<ItemGroup>
<MetaDataFile Include="$(VsmdiPath)">
<TestList>TestList1</TestList>
</MetaDataFile>

<MetaDataFile Include="$(VsmdiPath)">
<TestList>TestList2</TestList>
</MetaDataFile>
</ItemGroup>

More to come....