Modifying contents of CruiseControl.NET email results
posted by Bryan on
With a couple thousand tests, the email can be pretty big when viewing the results. We decided we only wanted the high level summary rather than the nitty gritty details.
Using CruiseControl.NET, you can configure an email to be sent for different types of events with your continuous build system. We have cc.net configured to run a NAnt target, which then runs our tests (and other reporting targets).
Example: Here is a snippet from the ccnet.config file where the project is configured. We call the daily target in our default.build.
<nant> <executable>nant.exe</executable> <basedirectory>C:\mypath</basedirectory> <buildargs>daily</buildargs> <nologo>false</nologo> <buildfile>default.build</buildfile> <logger>NAnt.Core.XmlLogger</logger> <buildtimeoutseconds>12000</buildtimeoutseconds> </nant>
Example from the default.build file for NAnt:
<target name="daily" depends="clean, compileDebug, daily_test_suites, generate_report, post_results"> </target>
The target "generate_report" crunches some numbers for some customized reporting. We create an xml file with those results. We also created our own xsl file to parse through that xml file when it is then merged into the master files with ccnet.
So -- in order to show that customized report, I just had to edit the ccnet.exe.config file to include it.
<!-- Specifies the stylesheets that are used to transform the build results when using the EmailPublisher --> <xslfiles> <file name="xsl\header.xsl"> </file><file name="xsl\compile.xsl"> </file><file name="xsl\mycustomreport.xsl"> <!-- obviously located in the directory to spit out results--> <!-- <file name="xsl\unittests.xsl" />--> <!-- <file name="xsl\fit.xsl" />--> </file><file name="xsl\modifications.xsl"> <!-- <file name="xsl\fxcop-summary.xsl" />--> </file></xslfiles>
Now, when the email is sent - I only get the summary of our customized results rather than the extensive details (which you can find anyways on the provided web page linked in the email).