Using CoverMe with Jenkins

Mar 6, 2012   #jenkins  #ci  #ruby  #rails  #coverage  #testing 

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: {% codeblock lang:ruby%} task :report do require ‘cover_me’ CoverMe.config.formatter = CoverMe::EmmaFormatter CoverMe.config.at_exit = {} CoverMe.complete! end ```

  • Configure your build job in Jenkins to publish the Emma coverage results from coverage/coverage.xml.