Anyway, getting ncover wasn't a big deal, I added the following section to the ccnet.config file for our project:
<exec> <executable>C:\Program Files\NCover\NCover.Console.exe</executable> <baseDirectory>C:\Builds\myproject\Source</baseDirectory> <buildArgs>"C:\Program Files\NUnit 2.5.2\bin\net-2.0\nunit-console-x86.exe" MyProjectUnitTests.nunit /xml:..\Artifacts\nunit.xml //x ..\Artifacts\ncover.xml //a Assembly.1;Assembly.2;Assembly.3</buildArgs> <buildTimeoutSeconds>360</buildTimeoutSeconds> </exec>
This worked first shot. The unit tests ran, and the code in the assemblies I'd defined was analysed and added to the CruiseControl report (make sure you include the output xml files in your publisher/merge section too). All fine and well, except now my builds were failing. Looking at the logs, the unit tests were ALL passing, everything was fine, except there was an unhandled AppDomain exception being raised by NUnit. Running this on my machine didn't produce the same result - it was only happening on the build server. The exact exception message was:
System.AppDomainUnloadedException: Attempted to access an unloaded AppDomain.
It turns out, this is strange bug in NUnit 2.5.2, and as of now, there is no fix. Fortunately, this doesn't happen with version 2.4.7 - so for this project all I did was point to a different version of NUnit, and the errors went away. The older version does seem siginificantly slower than version 2.5.2 so it's not optimal, but until a newer version comes out with a fix, it's good enough for me.
Hi Matt
ReplyDeleteDid you find any solution to this?
/Roger
Hi Roger,
ReplyDeleteAt the time I had to use NUnit version 2.4.7 to get around this.
I think this is now resolved in 2.5.5+ though.
Cheers
Matt
Thanks for the tip!
ReplyDelete