Permalink
Browse files

Parallel tests

Run rspec tests in different processes for different files. Speeds up testing by roughly 6x.
  • Loading branch information...
1 parent 55de4ee commit 155b2f64fc348c86ce6ecc17c8e7c15157214c57 @schneems schneems committed with hone May 19, 2013
Showing with 20 additions and 5 deletions.
  1. +3 −2 Gemfile
  2. +5 −1 Gemfile.lock
  3. +12 −2 README.md
View
@@ -1,9 +1,10 @@
-source "http://rubygems.org"
+source "https://rubygems.org"
-group :development do
+group :development, :test do
gem "heroku_hatchet"
gem "rspec-core"
gem "rspec-expectations"
gem "excon"
gem "rake"
+ gem "parallel_tests"
end
View
@@ -1,5 +1,5 @@
GEM
- remote: http://rubygems.org/
+ remote: https://rubygems.org/
specs:
activesupport (3.2.13)
i18n (= 0.6.1)
@@ -21,6 +21,9 @@ GEM
i18n (0.6.1)
mime-types (1.22)
multi_json (1.7.2)
+ parallel (0.6.5)
+ parallel_tests (0.13.1)
+ parallel
progress (2.4.0)
rake (10.0.4)
rest-client (1.6.7)
@@ -36,6 +39,7 @@ PLATFORMS
DEPENDENCIES
excon
heroku_hatchet
+ parallel_tests
rake
rspec-core
rspec-expectations
View
@@ -35,7 +35,11 @@ The buildpack will detect your app as Ruby if it has a `Gemfile` and `Gemfile.lo
#### Run the Tests
-Clone the repo, then `bundle install` then clone the test fixtures by running:
+The tests on this buildpack are written in Rspec to allow the use of
+`focused: true`. Parallelization of testing is provided by
+https://github.com/grosser/parallel_tests this lib spins up an arbitrary
+number of processes and running a different test file in each process,
+it does not parallelize tests within a test file. To run the tests: clone the repo, then `bundle install` then clone the test fixtures by running:
```sh
$ hatchet install
@@ -44,7 +48,13 @@ $ hatchet install
Now run the tests:
```sh
-$ bundle exec rspec spec
+$ bundle exec parallel_rspec -n 6 spec/
+```
+
+If you don't want to run them in parallel you can still:
+
+```sh
+$ bundle exec rake spec
```
Now go take a nap or something for a really long time.

0 comments on commit 155b2f6

Please sign in to comment.