How do I see test results in CruiseControl.net?

If you're using CruiseControl.net for continuous integration services, you can see the unit test results for xUnit.net on the build summary page.

To install support for CCnet

  • Configure the xUnit.net MSBuild task to output with the Xml= attribute, as shown below:
<Project DefaultTargets="Test" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">

  <UsingTask
    AssemblyFile="xunit.runner.msbuild.dll"
    TaskName="Xunit.Runner.MSBuild.xunit"/>

  <Target Name="Test">
    <xunit Assembly="test.xunit\bin\Debug\test.xunit.dll" Xml="test.xunit.dll.xml"/>
  </Target>

</Project>
  • Edit your CCnet build task (in C:\Program Files\CruiseControl.NET\server\ccnet.config) to merge your XML files into the CCnet build ouput, as shown below:
  <project>
    <name>MyProject</name>
    [...]
    <publishers>
      <merge>
        <files>
          <file>D:\Builds\MyProject\Test.*.xml</file>
        </files>
      </merge>
      <xmllogger />
      <statistics />
    </publishers>
    [...]
  </project>
  • Download the xUnitSummary.xsl file and save it to C:\Program Files\CruiseControl.NET\webdashboard\xsl
  • Edit C:\Program Files\CruiseControl.NET\webdashboard\dashboard.config and add a line for the summary, as shown below (highlighted in yellow):
dashboard-config.png
  • Reset the IIS server that's running CCnet
  • Force a build and see the results! They should look similar to the following:
sample-output.png

Last edited Apr 11, 2009 at 10:07 PM by BradWilson, version 6

Comments

jmairs Dec 1, 2011 at 7:45 PM 
I confrim this works great with xunit 1.8 and CruiseControl.NET 1.6.7981.1

jmairs Dec 1, 2011 at 6:10 PM 
I have 1.8 and am wondering if its part of the 1.8 download and is it working?

ilias Jul 20, 2010 at 4:47 PM 
Version 1.6 works fine without issue.

ilias Jul 19, 2010 at 8:37 PM 
I used version 1.5 with the latest ccnet version. May be xUnitSummary.xsl is incompatible with the report msBuild is generating.

BradWilson Jul 19, 2010 at 6:46 PM 
I'll give it a try with version 1.6.1. I haven't used CCnet with xUnit.net in a while. I don't know why it would've changed, but we'll see. :) Thanks!

ilias Jul 19, 2010 at 6:19 PM 
Not working for me. Showing Test Run: 0 Failures 0 Skipped: 0. But i have 63 passed tests.