Disclaimer: I’m a CruiseControl newbie, so there might well be a much better / simpler / cleaner method to achieve this. However this is the way I managed to get it working.
- Write your (Perl) script and make it output something like this:
<testsuite tests="0" name="summary" failures="0"><system-out> foo bar </system-out></testsuite>
- Make your script run during the build. This can be done directly using exec or in an ant subtask using the exec task. One thing to keep in mind is that CC stops at the first failure – this can be important if you want to run your script even during failures (because it collects statistics about the failures for example)
- Check that the output is present in the XML resulting from the XML log.
- Hack the XSL such that the contents are displayed in the result HTML email for example:
<table align="center" cellpadding="2" cellspacing="0" border="0" class="header" width="98%"><tr><td> <pre><xsl:value-of select="/cruisecontrol/testsuite[@name='summary']/system-out" /></pre> </td></tr></table>
That’s it folks! Hope that somebody finds it useful.
Picture taken chippenziedeutch's photostream with permission.
0 comments:
Post a Comment
You can use some HTML tags, such as <b>, <i>, <a>. Comments are moderated, so there will be a delay until the comment appears. However if you comment, I follow.