问题
After much confusion, I have finally managed to successfully deploy a instance of Cruise Control .net on our build server. It polls the server every few minutes and builds only if it detects changes in the svn repository. For building and testing, I am using a combination of MSBuild and NUnit. MSBuild deletes all the previously generated test result xml files, builds the projects and runs NUnit. Finally I include the results generated from the test results into the current Cruise Control build result using Publisher\Merge option in the ccnet.config
The results are pretty great. However the logs generated are enormous and hard to go thru. I was looking the the cruise control's own instance at http://ccnetlive.thoughtworks.com/ccnet/server/CCNet%20Live/project/NetReflector/ViewProjectReport.aspx and there build report has more options included on the side like NUnit results etc.
I have tried to install multiple packages from the CCnet Administer Dashboard but none of the newly installed packages appear on the dashboard. I am guessing that I have to do more than just install these packages like tinker with the configuration files but I cannot figure out how. Does anyone have any experience in that regard?
回答1:
The best way is to call Nunit directly from your Cruise Control :
<tasks>
<msbuild>
<executable>C:\WINDOWS\Microsoft.NET\Framework\v3.5\MSBuild.exe</executable>
<workingDirectory>D:\Compil\src\net-3.5\MyProject\trunk</workingDirectory>
<projectFile>MyProject.sln</projectFile>
<buildArgs>/p:Cible="DEV"</buildArgs>
<targets>Clean;Build</targets>
<timeout>600</timeout>
<logger>D:\CruiseControl.NET\server\ThoughtWorks.CruiseControl.MSBuild.dll</logger>
</msbuild>
<nunit>
<path>C:\Program Files\NUnit 2.5.7\bin\net-2.0\nunit-console.exe</path>
<assemblies>
<assembly>D:\Compil\src\net-3.5\MyProject\trunk\Tester\Tester.exe</assembly>
</assemblies>
</nunit>
</tasks>
Doing this you don't have to manually merge files nor to manually delete nunit results file.
Finally if your report doesn't suit you, check the xsl files used to create it ( see Cruise Control .Net not showing Nant build errors )
Hope this helps.
来源:https://stackoverflow.com/questions/3728613/cruise-control-net-using-packages-and-showing-nunit-results