开发者

JRuby-friendly method for parallel-testing Rails app

开发者 https://www.devze.com 2022-12-31 04:03 出处:网络
I am looking for a system to 开发者_Python百科parallelise a large suite of tests in a Ruby on Rails app (using rspec, cucumber) that works using JRuby. Cucumber is actually not too bad, but the full r

I am looking for a system to 开发者_Python百科parallelise a large suite of tests in a Ruby on Rails app (using rspec, cucumber) that works using JRuby. Cucumber is actually not too bad, but the full rSpec suite currently takes nearly 20 minutes to run.

The systems I can find (hydra, parallel-test) look like they use forking, which isn't the ideal solution for the JRuby environment.


We don't have a good answer for this kind of application right now. Just recently I worked on a fork of spork that allows you to keep a process running and re-run specs or features in it, provided you're using an app framework that supports code reloading (like Rails). Take a look at the jrubyhub application for an example of how I use Spork.

You might be able to spawn a spork instance for your application and then send multiple, threaded requests to it to run different specs. But then you're relying on RSpec internals to be thread-safe, and unfortunately I'm pretty sure they're not.

Maybe you could take my code as a starting point and build a cluster of spork instances, and then have a client that can distribute your test suite across them. It's not going to save memory and will still take a long time to start up, but if you start them all once and just re-use them for repeated runs, you might make some gains in efficiency.

Feel free to stop by user@jruby.codehaus.org or #jruby on freenode for more ideas.

0

精彩评论

暂无评论...
验证码 换一张
取 消