Want to increase the value of your Hudson Reports with some test/code coverage data? For Ruby 1.8.7 there is a great plugin which uses metrics_fu to display reports within Hudson from Joseph Wilk. But in my case I wanted to use the latest Ruby-1.9.2 stable (in my case p136). The code analysis tools that metrics_fu uses are currently not compatible with 1.9.2, so I decided to use cover_me instead.
But how do you get the cover_me reports into Hudson? It’s actually very easy. Cover me comes with a Emma XML reporting formatter, that can generate XML coverage reports that you then can read with the Emma Hudson Plugin.
So here are the step-by-step instructions on how to configure Ruby 1.9.2-p136, cover_me 1.0.0.rc6, Hudson 2.0.1, Hudson Emma Plugin 1.25 and Rails 3.0.9
- Add the following to your Gemfile
- Run
bundle installto install cover_me and it’s dependencies - Now run the cover_me installer
rails g cover_me:install - Edit the cover_me rake tasks file to have it output the coverage reports in the Emma XML format.
- Commit your changes and login to your Hudson server.
- Configure your project and enable Emma Reports for your project.
- That’s it!
For your interest here is my bash-script for running rspec and cucumber with Hudson and generate the Emma Reports:
Tags: coverage, cover_me, hudson, metrics_fu, rails, ruby-1.9.2





