A JRuby-friendly method for testing a Rails application in parallel
I am looking for a system to parallelize a large set of tests in a Ruby on Rails application (using rspec, cucumber) that works using JRuby. Cucumber isn't really that bad, but a full rSpec kit currently takes almost 20 minutes.
The systems I can find (hydra, parallel test) look like they are using forking, which is not an ideal solution for a JRuby environment.
a source to share
We don't have a good answer for such an application right now. Most recently, I worked on a fork of spork , which allows you to support the process of starting and rerunning specs or functions in it, provided you are using an application framework that supports code reloading (like Rails). Take a look at the jrubyhub app for an example of how I'm using Spork.
You might be able to instantiate spork for your application and then send multiple requests with multiple threads to run different specs. But then you rely on the internals of RSpec to be thread safe, and unfortunately I'm pretty sure it isn't.
Perhaps you could take my code as a starting point and create a cluster of spork instances, and then have a client that can distribute your test suite through them. It won't save memory and will still take a long time, but if you start them all over and just reuse them for repeated runs, you can achieve some efficiency.
Feel free to stop at user@jruby.codehaus.org or #jruby on freenode for more ideas.
a source to share