Making Your Test Suite Scream with Specjour
You know all those other Macs you have lying around the house sitting idle all the time? Well I have some great news. You can finally put those freeloaders to work! With specjour ( http://github.com/sandro/specjour ), you can distribute your test suite across all the cores on your network!
It uses bonjour to communicate and can support multiple projects simultaneously. As long as the machine has the dependencies required for the test suite (gems and unix packages), it can participate in the testing goodness. The current contents of your project get rsync’d to the managers, so they will always match your local changes. You get started by installing it into your Rails project. First, setup the dependency in the test group of yourGemfile.
group :test do gem ‘specjour’, ‘0.2.5’ end
config/database.yml. A number needs to be appended to the test database name to support multiple simultaneous tests for the same project. It matches that used by parallel_test, so if you used that previously you should be all set.
test: database: blog_test<%=ENV['TEST_ENV_NUMBER']%>
specjour
rake specjour
specjour just like you did on the first machine. Back on your dev machine, run rake specjour again. This time you will see more workers in the list and your suite should run considerably faster. There are additional options you can pass to specify project names to listen for and how many cores to use, but for most people the defaults should work fine. Those options are passed to the manager and would look something like this: specjour --workers 4 --projects blinq,workbeast