views:

2641

answers:

3

I have a Nant build file which executes NUnit after compiling the dll's. I am executing the NAnt build file with a task in CruiseControl. So NAnt is running the tests not CruiseControl.

How do I configure it so that the CruiseControl web dashboard can be used to view the NUnit output ?


This fixed it:

<publishers>
    <merge>
     <files>
              <file>build\*.test-result.xml</file>
     </files>
    </merge>
    <xmllogger />
 </publishers>
+4  A: 

You want to use the merge capabilities of CruiseControl to grab your nunit XML output. Thie is the situation my company has going, and it seems to work fairly well. Here is a config snippet (This goes in the <publishers> element in ccnet,config):

 <merge>
     <files>
         <file><path to XML output>\*.xml</file>
     </files>
 </merge>

Hope this works for you.

ckramer
I see in server log it merges the file, but still I see no tests run if I select NUnit Details link in webdashboard.
HollyStyles
Important to place <xmllogger /> *after* the <merge> element within the <publishers> element in ccnet.config.
HollyStyles
Excellent point....I would like to see the CCNet config files become a little more forgiving of these things...or at least provide better feedback when things don't go right.
ckramer
A: 

Make sure that in the the dashboard.config file you have a valid xsl file in the section we run nunit with ncover and use this xsl\NCoverExplorer.xsl I think that the xsl file we took from the ncover install somewhere.

also make sure that this line is correct:

Then make sure in the ccnet.config file that under the section you have the xml output from the nunit test listed.

Also make sure you put the xsl file in the xsl folder under webdashboard.

Bob Dizzle
+1  A: 

FWIW I had the same problem (CC.Net fires off Nant which does the compile and NUnit work) and my NUnit output was not appearing on CC.Net either. I already had the <merge> task inside my <publisher> task (and before the <xmllogger> task) and still nothing.

The one thing that I did not have, b/c I didn't explicitly need it, was a <workingDirectory> node in my <project>. As soon as I added that my NUnit output appeared immediately. Looks as if there's a dependency there for whatever reason. Hope this helps some of you.

ScottD
Good find, flush out those dependencies!
HollyStyles