rspactor
rspactor copied to clipboard
Feature request: parallel_tests
When running all specs (Ctrl-), it'd be great if it could use parallel_tests
http://github.com/grosser/parallel_tests
I usually use 8 processes at the same time which makes my test suite go from about 5 minutes to about 60 seconds. Using parallel_tests is as simple as modifying the call you make to run all specs. (eg. rake parallel:spec[8] )
However different people might want different settings. I wonder if the solution would be to allow people to customize the command used to 'run all spec'?
Another nice feature would be to separate out running all model specs and all acceptance specs. This is because I use capybara/selenium for my acceptance spec meaning that they are much slower. It'd be nice to run just some but not others.
Steve
RSpactor do not use the rake task to launch specs but directly the rspec (2.0) or spec (1.3) command line, so I'm not sure if we can launch parallel:spec that way. Have you an idea about the way to customize the run all spec command?
About all model specs / all acceptance specs, I personally use the :focus => true option of RSpec 2.0 and it works pretty well for me. Just add this in your RSpec config:
config.filter_run :focus => true
config.run_all_when_everything_filtered = true
and add ,:focus => true inside your it/describe/context blocks: More info: http://blog.davidchelimsky.net/2010/06/14/filtering-examples-in-rspec-2/
Hope it'll help you! Thibaud
Yes according to their github page you can do this:
sudo gem install parallel_tests
go to your project dir
parallel_test OR parallel_spec OR parallel_cucumber
[Optional] use ENV['TEST_ENV_NUMBER'] inside your tests to select separate db/memcache/etc.
[optional] Only run selected files & folders:
parallel_test -n 8 test/bar test/baz/xxx_text.rb
But because it takes parameters it'd be nice if this command was customizable, perhaps in a .rspactorrc file. Regarding rake, you could always put it inside backticks :)
Ok I see, We really need to found a scalable way to handle all this case. Not easy. Have you tried the :focus option with RSpec?