Enabling Jenkins support with Ruby on Rails tests
-
Make sure you are using Rails 4.1+.
-
Use the
ci_reporter_minitestgem in yourGemfile, and runbundle update:
gem 'ci_reporter_minitest', '~> 1.0.0'
- Require the
ci:setup:minitesttask as a dependency of thetesttask:
# /Rakefile
# ...
Rrw::Application.load_tasks
# Require the reporter in your Rakefile, and ensure that ci:setup:minitest is a dependency of your minitest task:
require 'ci/reporter/rake/minitest'
task :test => 'ci:setup:minitest'
-
Run
rake test, andtest/reports/*.xmlshould be generated! -
Configure Jenkins to Publish JUnit test result report from
test/reports/*.xml,spec/reports/*.xml