This post originated from an RSS feed registered with Agile Buzz
by Jared Richardson.
Original Post: CruiseControl and Rails Testing
Feed Title: Jared's Weblog
Feed URL: http://www.jaredrichardson.net/blog/index.rss
Feed Description: Jared's weblog.
The web site was created after the launch of the book "Ship It!" and discusses issues from Continuous Integration to web hosting providers.
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.