reddy
reddy

Reputation: 141

Continuous Integration Testing for Ruby on Rails with Jenkins

Does anyone know of a way to do continuous integration testing with Ruby on Rails with Jenkins?

I have followed Rspec for writing test cases in ROR application.

I need to integrate Test process with jenkins CI.

If you could provide any pointers, I really would appreciate it.

Upvotes: 14

Views: 10278

Answers (2)

brendan
brendan

Reputation: 12121

Since Jenkins can run anything on the command line, the important part is allowing Jenkins to interpret the test output.

Basically what you need is this gem:

https://github.com/nicksieger/ci_reporter

The CI Reporter gem will output Test::Unit and RSpec test results as a JUnit-compatible XML file which Jenkins can interpret. I believe this is the key to integration.

Upvotes: 17

Ariejan
Ariejan

Reputation: 11069

Yes you can. Setup Jenkins, make sure Ruby is installed on your system (incl. RVM, bundler, mysql and whatever else you need).

Then create a job with these build commands;

#!/bin/bash
source ~/.profile
rvm use --create ruby-1.8.7@my_app
rvm --force gemset empty
gem install bundler --no-rdoc --no-ri
bundle install
cp config/database.yml.jenkins config/database.yml

bundle exec rake db:create:all
bundle exec rake db:migrate
bundle exec rake db:test:prepare

For cucumber

#!/bin/bash
source ~/.profile
rvm use ruby-1.8.7@my_app

bundle exec rake cucumber

For RSpec

#!/bin/bash
source ~/.profile
rvm use ruby-1.8.7@my_app

bundle exec rake spec

Upvotes: 15

Related Questions