Improving the speed of specs/test cases

Continuous Integration is something which most of us use as a part of our developer daily chore.. We tend to make sure each time the code is integrated it is clean and at least it dose not break the existing code.

If we are lucky enough we end up waiting for our test cases to run for ages.. and ages… We will start cleaning our spec/tests code and end up cleaning most of it.. yet we they might run slow enough to let us make a coffee and order a pizza..

To avoid such I have used parallel tests(written by Michael Grosser) which gave a bumping speed to the execution of my test cases.

This helped me to speed up my test cases like increase their execution speed to 25-40%.

script/install git://github.com/grosser/parallel_tests.git

This speeds up the test cases/specs by running parallel on multiple CPUs.

time rake test:units test:functionals (without parallel test)

real 27m7.935s

user 14m24.070s

sys 3m13.452s

time rake parallel:test

real 24m23.257s

user 0m1.780s

sys 0m0.556s

Apart from this I also found DeepTest(David Vollbracht) git://github.com/qxjit/deep-test.git

DeepTest enables tests to run in parallel using multiple processes. Processes may spawned locally to take advantage of multiple processors on a single machine or distributed across many machines to take advantage of distributed processing.

DeepTest also claims that any number of projects can be executed(run) using the same test servers, as long as they’re all using the same version of Ruby and DeepTest.

Lets spend less time on waiting for the execution test cases/specs…

Advertisements
  1. Leave a comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: