Skip to content
This repository


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Run your ruby tests in parallel

branch: master

Fetching latest commit…


Cannot retrieve the latest commit at this time

Octocat-spinner-32 lib
Octocat-spinner-32 test
Octocat-spinner-32 .document
Octocat-spinner-32 .gitignore
Octocat-spinner-32 LICENSE
Octocat-spinner-32 README.rdoc
Octocat-spinner-32 Rakefile
Octocat-spinner-32 VERSION
Octocat-spinner-32 multitest.gemspec



Multitest is still very young, it is in active development and is no where near complete or robust.

Multitest currently only works in a rails environment. It's only because I use “constantize”.

If you depend on fixture data in your database, you may have data inconsistency errors. I like to use an empty DB and then use factories with transactional tests, and this runs great.


You will need to have Gemcutter in your list of gem sources.

gem install multitest


in your Rakefile:

require 'multitest'
require 'multitest/tasks'

on the commandline:

rake multitest
rake multitest:units multitest:functionals multitest:integration


in your Rakefile:

Multitest.cores = 8


This is one of our largest apps.

Normal suite

time rake test
259.03user 27.50system 5:14.76elapsed 91%CPU

2 Cores

time rake multitest
213.86user 23.38system 2:41.24elapsed 147%CPU

4 Cores

time rake multitest
223.18user 24.53system 2:08.96elapsed 192%CPU

Note the wall-time differences of 5:14 vs 2:41. 195% speedup on two cores. On 4 cores there is only a speedup of 243%, but that's still quicker. If you send me impressive benchmarks, I'll be happy to put them up here (8 cores anyone?).

Require Errors

If you get require errors like:

Running multitest:units
rake aborted!
no such file to load -- test_helper

Then you may want to use more absolute paths in your tests. For example, if you had:

# test/unit/my_class.rb
require 'test_helper'
class MyClass < ActiveSupport::TestCase

You should change it to:

# test/unit/my_class.rb
require File.join(File.dirname(__FILE__), '..', 'test_helper')
class MyClass < ActiveSupport::TestCase

Note on Patches/Pull Requests

  • Fork the project.

  • Make your feature addition or bug fix.

  • Add tests for it. This is important so I don't break it in a future version unintentionally.

  • Commit, do not mess with rakefile, version, or history. (if you want to have your own version, that is fine but bump version in a commit by itself I can ignore when I pull)

  • Send me a pull request. Bonus points for topic branches.


Copyright © 2009 Nick Gauthier. See LICENSE for details.

Something went wrong with that request. Please try again.