rspec_parallel is a ruby gem that allows to run rspec examples/tests in parallel.
- Tests are distributed dynamically for each thread
- Tests are executed alphabetically, rewrite RspecParallel.reorder_tests to change
- Junit-format xml report is generated after each run
- Re-run failures are supported
- Integrate progressbar gem to show the execution progress
- progressbar >= 0.11.0
- Mac OS X 64bit, 10.6 and above
- Ubuntu 10.04 LTS 64bit
- gem install rspec_parallel (or add it into Gemfile)
- Sample code:
require 'rspec_parallel'
options = {}
options[:thread_number] = 4 # default: 10
options[:env_list] = [] # you can pass different env vars to each thead
options[:filter] = {"tags" => "mysql,~slow", "pattern" => /(ruby|java)/} # filter tests by tags or regular expressions
options[:show_pending] = true # show all pending tests after the run
options[:rerun] = true # rerun failures of last run
options[:single_report] = true # for rerun, update a single report; if set to false, generate separate reports.
# all supported options and default values
# @options = {:thread_number => 4, :case_folder => "./spec/", :report_folder => "./reports/",
# :filter => {}, :env_list => [], :show_pending => false, :rerun => false,
# :single_report => false, :max_rerun_times => 10, :max_thread_number => 16,
# :longevity_time => 0}.merge(options)
#
rp = RspecParallel.new(options)
rp.run_tests