[rspec-users] [Cucumber] [Ann] Salad, aka Multi-instance Cucumber
loop at superinfinite.com
Wed May 20 05:10:49 EDT 2009
(Apologies for crossposting)
Yesterday, my pair and I wrote a rough rake task to run features
against multiple instances of Cucumber. We decided to call it Salad,
since multiple cucumbers makes a nice salad :). The script is very
rough, and scratches mostly our own itch. The rake task itself can be
found at http://gist.github.com/114709.
On a 8-core Mac Pro running with 8 instances, we see a speed increase
of roughly 75%, reducing running time of our entire suite from ~7m30s
to ~2m30s. We've only tested this script on Mac OS X 10.5.
Basic flow is this:
- Create n extra test databases, similar to the test database in
- Split all features evenly in n feature "groups"
- Fork n Cucumber processes, and let them run their designated feature
We both are neither Cucumber internal experts, nor Ruby experts, so
this could use a lot of work. I personally would love to have this all
as a command line option to cucumber itself.
Two major caveats:
- You need to explicitly set RAILS_ENV to 'test'. We couldn't find an
easy way to force this env from within the rake task
- The project we used to test this all on has some random failures on
specific features with this rake task, whereas rake features doesn't
report any failures at all. This could probably have something to do
with either transactional fixtures or some sort of memory leaks. We
found it happens more frequent when using more instances of cucumber.
So, try it out from http://gist.github.com/114709, and post your
More information about the rspec-users