forked from grosser/parallel_tests
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
- Loading branch information
Jason Morrison
committed
Jan 14, 2010
1 parent
a142284
commit 8a0be78
Showing
8 changed files
with
3 additions
and
574 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -1,78 +1,5 @@ | |||
Rake tasks to run specs and tests in parallel, to use multiple CPUs and speedup test runtime. | You should use: | ||
|
|
||
Setup | http://github.com/grosser/parallel_specs | ||
===== | |||
|
|
||
For this fork (to be removed before pulling upstream): | because it's awesome! And regularly updated. | ||
|
|||
script/plugin install git://github.com/jasonm/parallel_specs.git | |||
|
|||
For the upstream plugin: | |||
|
|||
script/plugin install git://github.com/grosser/parallel_specs.git | |||
|
|||
Add <%= ENV['TEST_ENV_NUMBER'] %> to the database name for the test environment in `config/database.yml`, | |||
it is '' for process 1, and '2' for process 2. | |||
|
|||
test: | |||
adapter: mysql | |||
database: xxx_test<%= ENV['TEST_ENV_NUMBER'] %> | |||
username: root | |||
|
|||
For each environment, create the databases | |||
mysql -u root -> create database xxx_test2; | |||
|
|||
Run like hell :D | |||
|
|||
rake spec:parallel:prepare[2] #db:reset for each database | |||
|
|||
rake spec:parallel[1] --> 86 seconds | |||
rake spec:parallel --> 47 seconds (default = 2) | |||
rake spec:parallel[4] --> 26 seconds | |||
... | |||
|
|||
Example output | |||
-------------- | |||
2 processes for 210 specs, ~ 105 specs per process | |||
... test output ... | |||
|
|||
Results: | |||
877 examples, 0 failures, 11 pending | |||
843 examples, 0 failures, 1 pending | |||
|
|||
Took 29.925333 seconds | |||
|
|||
Test::Unit | |||
---------- | |||
|
|||
To run Test::Unit tests, use the following task: | |||
|
|||
rake test:parallel | |||
|
|||
instead of | |||
|
|||
rake spec:parallel | |||
|
|||
This includes the ability to specify more than two parallel environments. | |||
|
|||
TIPS | |||
==== | |||
- `./script/generate rspec` if you are running rspec from gems (this plugin uses script/spec which may fail if rspec files are outdated) | |||
- with zsh this would be `rake "spec:parallel:prepare[3]"` | |||
|
|||
TODO | |||
==== | |||
- find out how many CPUs the user has [here](http://stackoverflow.com/questions/891537/ruby-detect-number-of-cpus-installed) | |||
- grab the 'xxx examples ..' line and display them after all tests have finished | |||
|
|||
Authors | |||
==== | |||
inspired by [pivotal labs](http://pivotallabs.com/users/miked/blog/articles/849-parallelize-your-rspec-suite) | |||
|
|||
###Contributors | |||
- [Joakim Kolsjö](http://www.rubyblocks.se) -- joakim.kolsjo<$at$>gmail.com | |||
- [Jason Morrison](http://jayunit.net) -- jason.p.morrison<$at$>gmail.com | |||
|
|||
[Michael Grosser](http://pragmatig.wordpress.com) | |||
grosser.michael@gmail.com | |||
Hereby placed under public domain, do what you want, just do not hold me accountable... |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
8a0be78
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks, will make hopefully installers life easier :)
8a0be78
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hopefully <-> make ;)