Running Ruby tests in multiple proccesses via deepTest
Published: October 4th, 2007Have you ever had the problem when your testing time exceeds over a minute each time you run your suite? If so, you’d realize that minute adds up very quickly over the course of an hour if you’re constantly running your testing environment. Unfortunately this is a complete drag and can even motivate you to avoid running your tests, which you know is a horrible idea.
Luckily, something called deepTest has arrived which hopes to solve this problem of long-running-tests if you have a processor with multiple cores. The more cores the better, according to them.
As far as I can tell, it’s made for TestUnit; which is lame because I use RSpec. They provide the following snippet to bake this into your Rakefile for TestUnit:
require "rubygems" require "deep_test/rake_tasks" DeepTest::TestTask.new "task_name" do |t| t.pattern = "test/**/*_test.rb" t.processes = 2 # optional, defaults to 2 end
I modified it a bit to look like this; in hopes of getting deepTest to run RSpec:
# sample DeepTest task DeepTest::TestTask.new "deep_test" do |t| t.pattern = "spec/**/*_spec.rb" t.processes = 2 # optional, defaults to 2 end
Unfortunately it didn’t seem to work that well on my MacBook Pro. Instead of the usual minute that it takes to run the tests, it took over 120 seconds! Something doesn’t seem to be working with the program correctly, or it just doesn’t work at ALL for specs. I figured it what just a way to split some processing between the cores, but it may be more complicated than that and made specifically for TestUnit right now. Hopefully they’ll bake some RSpec power in.
Verdict is that it’s a cool idea, and you should probably try it out. Let me know if you get better results than I did.

David Vollbracht added RSpec support do DeepTest. The latest gem should make that test suite nearly twice as fast. Take a look at the README: http://github.com/qxjit/deep-test/tree/master
Ready. Set. Go.
In terms of the formatting, you're allowed to use markdown, textile, or basic html; it's truly up to you -- what strikes your fancy?
You don't have to worry about your e-mail address being sold to a russian-spam-mafia. I'm only going to use it for my own weird needs; like asking you out for a date on a lonely night of coding.