RubyBlocks

How we made our tests fast using the testbot test distribution tool

We had a pretty common problem at work. Our test suite was starting to take way too long to run and the conventional methods like optimizing slow tests weren’t quite enough.

How it used to be

Slow specs part 1 Slow specs part 2

30 minutes

How it is now

Fast specs part 1 Fast specs part 2

2 minutes!

Background

Initially we found the parallel_tests project which allowed use of both the cores of our machines which essentially cut the test runtime in half. As the suite was still a bit too heavy we started to look for tools that would allow us to use all our computers when running the tests.

The first project we found was DeepTest but never actually got up and running with it as it seemed way too complex.

We also found specjour but it was designed to work with bonjour which would have limited us to only be able to run our tests fast when at the office. It would also not be possible to use other idle server resources.

Introducing testbot

I decided to create testbot. It’s been almost a year in the making and this week it was released as a gem with a simple command line interface.

Testbot is designed around the idea that test distribution should be easy. One of the main benefits of the system is that you can add and remove worker processes at any time and that the user only needs to be able to access a single server. Because of this you can use spare resources almost anywhere, developer workstations, virtualized servers, PXE booted clusters, Amazon EC2,

A short example of how testbot is used:

Testbot currently supports Test::Unit, RSpec, Cucumber, Rails 2 and Rails 3.

More info at http://github.com/joakimk/testbot

Try it out!

 gem install testbot

Comments

blog comments powered by Disqus
Fork me on GitHub