The Artima Developer Community
Sponsored Link

Agile Buzz Forum
Run your Ruby Test and Get JUnit HTML or XML

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Jared Richardson

Posts: 1031
Nickname: jaredr
Registered: Jun, 2005

Jared Richardson is an author, speaker, and consultant who enjoys working with Ruby and Rails.
Run your Ruby Test and Get JUnit HTML or XML Posted: Sep 20, 2006 1:15 PM
Reply to this message Reply

This post originated from an RSS feed registered with Agile Buzz by Jared Richardson.
Original Post: Run your Ruby Test and Get JUnit HTML or XML
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.
Latest Agile Buzz Posts
Latest Agile Buzz Posts by Jared Richardson
Latest Posts From Jared's Weblog

Advertisement

This is a problem I've needed resolved for a while, and others on the Cruise Control mailing list have also asked about it. But thanks to the hard work of Alexey Verkhovsky, the problem appears to be solved.

There isn't a mature Continuous Integration solution available for Ruby and Rails projects, so we wrap our Rake scripts in Ant scripts and run them from Cruise Control. This isn't an ideal solution because the Ant script only sees a binary pass or fail for the entire suite. It doesn't know about the 137 tests you ran with 7,014 asserts. It just sees that everything passed or something failed. In order for Cruise Control to properly report on the test results, you need a JUnit formatted XML file.

Last night at our local Ruby Meetup, I asked Nathaniel Talbot (the guy who wrote Test::Unit) what he thought about using AspectR to solve this problem, and Nathaniel pointed me to this new project, Test/Unit Report.

Here's the homepage, complete with sample code.

I downloaded the project today from the Ruby Forge page.

It's a new project, and it had a few wrinkles. I've sent mail to Alex, but if you want to get started today, here's what I had to do.

In reporter.rb (located in /usr/local/lib/ruby/site_ruby/1.8/test/unit/ui on my box), I had to add

require 'test/unit/ui/console/testrunner'

And in the documentation, anything that refers to ui/reporter/reporter should be ui/reporter

For instance, require 'test/unit/ui/reporter/reporter' should be require 'test/unit/ui/reporter''

Given that this is a brand new project, these are minor bumps in the road for a nice JUnit log file for my Ruby automated tests. I suspect by the time you read this and try it out yourself, these problems will all be solved.

Enjoy!

Jared

Read: Run your Ruby Test and Get JUnit HTML or XML

Topic: Mulling Video Blogs Previous Topic   Next Topic Topic: I spoke too soon about the battery

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use