Project

rspeed

0.0
No commit activity in last 3 years
No release in over 3 years
There's a lot of open issues
Split and speed up your RSpec tests.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies
 Project Readme

RSpeed

CI Gem Version Maintainability Coverage Sponsor

RSpeed splits your specs to you run parallels tests.

Install

Add the following code on your Gemfile and run bundle install:

gem 'rspeed'

Setup

We need to extract the rake that executes the split via rspeed:run.

rake rspeed:install

Usage

  • RSPEED_APP: You app name to avoid data override
  • RSPEED_PIPE: Current pipe
  • RSPEED_PIPES: Quantity of pipes
  • RSPEED_SPEC_PATH: The specs folders path
  • RSPEED: Enables RSpeed
RSPEED=true RSPEED_APP=blog RSPEED_PIPE=1 RSPEED_PIPES=3 bundle exec rake rspeed:run

How it Works

First run

  1. Since we have no statistics on the first time, we run all specs and collect it;
{ "file": "./spec/models/1_spec.rb", "time": 0.01 }
{ "file": "./spec/models/2_spec.rb", "time": 0.02 }
{ "file": "./spec/models/3_spec.rb", "time": 0.001 }
{ "file": "./spec/models/4_spec.rb", "time": 1 }

Second and next runs

  1. Previous statistics is balanced by times and distributed between pipes:
{ "file": "./spec/models/4_spec.rb", "time": 1 }
{ "file": "./spec/models/2_spec.rb", "time": 0.02 }
{ "file": "./spec/models/3_spec.rb", "time": 0.001 }
{ "file": "./spec/models/1_spec.rb", "time": 0.01 }
  1. Run the current pipe 1:
{ "file": "./spec/models/4_spec.rb", "time": 1 }
  • Collects statistics and temporary save it;
  1. Run the current pipe 2:
{ "file": "./spec/models/2_spec.rb", "time": 0.02 }
  • Collects statistics and temporary save it;
  1. Run the current pipe 3:
{ "file": "./spec/models/3_spec.rb", "time": 0.001 }
{ "file": "./spec/models/1_spec.rb", "time": 0.01 }
  • Collects statistics and temporary save it;
  • Sum all the last statistics and save it for the next run;