We ended up running tests in parallel through MSBuild, and then merging the resulting (several) test results files into one file for ease of reporting - CC.Net would be happy to do this for you on the build server, but itβs nice that the developers also have significant results on their own cars.
An example code looks something like this:
<Target Name="UnitTestDll"> <Message Text="Testing $(NUnitFile)" /> <ItemGroup> <ThisDll Include="$(NUnitFile)"/> </ItemGroup> <NUnit ToolPath="$(NUnitFolder)" Assemblies="@(ThisDll)" OutputXmlFile="$(TestResultsDir)\%(ThisDll.FileName)-test-results.xml" ExcludeCategory="Integration,IntegrationTest,IntegrationsTest,IntegrationTests,IntegrationsTests,Integration Test,Integration Tests,Integrations Tests,Approval Tests" ContinueOnError="true" /> </Target> <Target Name="UnitTest" DependsOnTargets="Clean;CompileAndPackage"> <Message Text="Run all tests in Solution $(SolutionFileName)" /> <CreateItem Include="$(SolutionFolder)**\bin\$(configuration)\**\*.Tests.dll" Exclude="$(SolutionFolder)\NuGet**;$(SolutionFolder)**\obj\**\*.Tests.dll;$(SolutionFolder)**\pnunit.tests.dll"> <Output TaskParameter="Include" ItemName="NUnitFiles" /> </CreateItem> <ItemGroup> <TempProjects Include="$(MSBuildProjectFile)"> <Properties>NUnitFile=%(NUnitFiles.Identity)</Properties> </TempProjects> </ItemGroup> <RemoveDir Directories="$(TestResultsDir)" Condition = "Exists('$(TestResultsDir)')"/> <MakeDir Directories="$(TestResultsDir)"/> <MSBuild Projects="@(TempProjects)" BuildInParallel="true" Targets="UnitTestDll" /> <ItemGroup> <ResultsFiles Include="$(TestResultsDir)\*.xml" /> </ItemGroup> <NUnitMergeTask FilesToBeMerged="@(ResultsFiles)" OutputPath="$(MSBuildProjectDirectory)\TestResult.xml" /> </Target>
source share