This post originated from an RSS feed registered with Ruby Buzz
by Jared Richardson.
Original Post: CruiseControl and Rails Testing
Feed Title: 6th Sense Analytics
Feed URL: http://www.6thsenseanalytics.com/?feed=rss
Feed Description: The 6th Sense Analytics corporate blog
I posted on this topic (and here as well) a few weeks ago but received several emails asking for more specifics, so here you go.
An Ant script to run Rake tasks, and detect failures.
<target name="rails-build" >
<echo message="Running rails tests via rake ci task..."/>
<exec
executable="rake"
output="/path_to_cc/cruisecontrol-bin-2.5/logs/my_project_name/rake-output.log"
outputproperty="rake.output">
</exec>
<!-- check for error string 'rake aborted', and fail build if it
is found -->
<fail message="Rake failed, because 'rake aborted' string was
found in build output">
<condition>
<contains string="${rake.output}"
substring="rake aborted"
casesensitive="false"/>
</condition>
</fail>
<echo message="Rails tests via rake ci task completed
successfully (no string 'rake aborted' found)"/>
</target>
I was also asked for a specific example of how to integrate Test-Report with Ant and CruiseControl. I don't have a working configuration in front of me at the moment and, due to time constraints, can't reproduce one right now. For now, check out to docs on their Test Report page.
I've got a short trip to California this week, but I'll integrate with a project I'm working on now, then post the steps by the end of this week or the first of next.