This page last changed on Aug 25, 2005 by poobah.
Summary

The following information explains how to show mbUnit reports in the CruiseControl for .NET web dashboard.

There are two ways you can run MbUnit with CCNet, use a plugin as described below (edited to reflect the fact the XSL is now included in the CCNet distro) or you can simply replace the stock XSL files with the MbUnit XSL files.

Stock replacement

In the XSL folder replace tests.xsl and unittests.xsl with the MbUnit replacements. Make sure that you include the MbUnit XML file in CCNet and you are good to go.

Plugin Method

I recently needed to update our build process to show our "mbUnit" reports on the "CruiseControl for .NET":http://confluence.public.thoughtworks.org/display/CCNET/Welcome+to+CruiseControl.NET Web dashboard. Trying to get all the pieces together to figure out how to do this was a scavenger hunt of sorts so I decided to put all the information I gathered into one place. This is the very basics of what I found and is fairly simple to implement right away. I'm sure there are more advanced ways of doing this but hopefully this information will get you going fairly quickly.

Acquire the xsl file

this is included in the CCNet distro

Create plugin for the Dashboard

  • Make sure you have the latest "source":http://sourceforge.net/project/showfiles.php?group_id=71179 of CruiseControlDotNET.
  • Open up the solution file ..\CruiseControl.NET-0.8.source\project\ccnet.sln
  • Navigate to the Webdashboard project's Plugins folder
  • Add a folder for mbUnit
  • Add a code file to the folder call mbUnitTestResultsPlugin.cs
  • Copy/Paste the following code in to the code file
using ThoughtWorks.CruiseControl.WebDashboard.Dashboard;
namespace ThoughtWorks.CruiseControl.WebDashboard.Plugins.mbUnit
{
	public class mbUnitTestResultsPlugin : XslReportBuildPlugin
	{
		public mbUnitTestResultsPlugin(IBuildLogTransformer buildLogTransformer)
		: base (buildLogTransformer, @"xsl\mbUnit.xsl", "View mbUnit Report", "ViewmbUnitReport")
		{ }
	}
}
  • Compile the project

Deploy

  • Copy the newly compiled Webdashboard assembly to the deployment machine's ..\webdashboard\bin folder
  • copy the xsl file to the deployment machine's ..\webdashboard\xsl folder
  • Added the new plungin and xsl information to the web.config file
<buildPlugins>
	...
	<plugin typeName="ThoughtWorks.CruiseControl.WebDashboard.Plugins.mbUnit.mbUnitTestResultsPlugin" />
</buildPlugins>
<xslFiles>
	...
	<file name="xsl\mbUnit.xsl" /> <!-- If you want to show report on main page -->
</xslFiles>

Putting it all together

  • To make it all work make sure your build script is running mbUnit and generating an xml report
  • In the CruiseControls server config file merge the mbUnit xml report
<tasks>
	<merge>
		<files>
			...
			<file>..\results\mbUnit-report.xml</file>
		</files>
	</merge>
</tasks>

Originally posted on Andrew's Blog, Test Bed

Document generated by Confluence on Jun 11, 2007 11:56