Hi,
I am running CC.Net and everything is going well. Our code compiles
relatively quickly but our nUnit tests take a long (very long - 20+
minutes) time to run. Further - we will be adding another tool to add
on custom regression testing in the near future which will also be
very time consuming (lots of financial calcs).
So --- after the build - what is the best way to parallelize the nUnit
and regression tests. We have roughly 23 dlls and the nUnit tests for
each dll are 100% self-contained (or copies have already been made
available to each testing location). So - in a perfect world - my IT
department would spin up 23 processors and I would whip through the
testing (I will assume that I get 2 or 4 processors - no IT department
would ever give us 23 processors :) ). The regression testing is
almost as easy to partition (a bit of copying and then off to the
heavy lifting).
My nUnit task currently looks like (it is simply a target in my
MSBuild file that I call for compiling/testingfrom my ccnet.config
file):
config file:
<project name="MainStream">
...
<prebuild>
</prebuild>
<tasks>
<msbuild>
<executable>$(msbuildexe)</executable>
<workingDirectory>C:\builds\mainstream\CC\ArtifactDirectory</
workingDirectory>
<projectFile>$(artifactDirectory_dir)\Netbuildscript.xml</
projectFile>
<buildArgs> /noconsolelogger /v:quiet /
l:FileLogger,Microsoft.Build.Engine;logfile=MyLog.log /
p:VCBuildToolPath="C:\Program Files\Microsoft Visual Studio 9.0\VC
\vcpackages"</buildArgs>
<timeout>3000</timeout>
<logger>$(msbuildlogger)</logger>
</msbuild>
</tasks>
<publishers>
...
</project>
nUnit target from "Netbuildscript.xml"
<Target Name="nUnitTest" DependsOnTargets="BuildTests">
<NUnit Assemblies="$(TestThisAgentInfo)\TestAgentInfo.dll;
$(TestThisCalcDefaults)\TestCalcDefaults.dll;
$(TestThisDataIO)\TestDataIO.dll;
$(TestThisDataManager)\TestDataManager.dll;
$(TestThisDiverse)\TestDiverse.dll;
$(TestThisFormInfo)\TestFormInfo.dll;
$(TestThisInputData)\TestInputData.dll;
$(TestThisInputInfo)\TestInputInfo.dll;
$(TestThisLogger)\TestLogger.dll;
$(TestThisPageInfo)\TestPageInfo.dll;
$(TestThisPageRender)\TestPageRender.dll;
$(TestThisSessionManager)
\TestSessionManager.dll;
$(TestThisSymTab)\TestSymTab.dll;
$(TestThisXML)\TestXML.dll;
$(TestThisCalculations)\TestCalculations.dll;
$(TestThisInit)
\TestInit.dll;
$(TestThisEDSDataMapper)\TestEDSDataMapper.dll;
$(TestThisEval)\TestEval.dll;
$(TestThisGuiManager)\TestGuiManager.dll;
$(TestThisValidations)\TestValidations.dll;
$(TestThisCore)\TestCore.dll;
$(TestThisWebMessage)\FPWebMessage.dll;
$(TestThisWebService)\FPReportMgrMain.dll;"
ToolPath="$(nUnitPath)"
DisableShadowCopy="true"
OutputXmlFile="$(ArtifactDirectory)\nUnitResults.xml"
ContinueOnError="true">
...
So - Assuming I get 2 processors (for now):
Has anyone done this kind of thing before?
What is the best way to approach this?
Do I parallelize from CC.Net (can I???) or from MSBuild?
If it is from MSBuild - is that easily done with nUnit (it seems easy
to do with compile tasks ...nUnit parallelization... I cannot find
much info)
Any help is appreciated ...
(and yes- I probably am missing something really obvious),
Joel