Using CoverMe With Jenkins

CoverMe is a code coverage tool for Ruby 1.9.

Using Jenkins for CI, you can display the coverage results in your project overview even though Jenkins does not support the original output format of CoverMe.

  • Download and install the Emma plugin via the Plugins page of your Jenkins installation.
  • Install CoverMe for your Rails project as described on the project page on GitHub.
  • Edit lib/tasks/cover_me.rake and make the :report task look like this:
1
2
3
4
5
6
task :report do
  require 'cover_me'
  CoverMe.config.formatter = CoverMe::EmmaFormatter
  CoverMe.config.at_exit = Proc.new {}
  CoverMe.complete!
end
  • Configure your build job in Jenkins to publish the Emma coverage results from coverage/coverage.xml.

Comments