Readme.md in parallel_tests-1.1.1 vs Readme.md in parallel_tests-1.2.0

- old
+ new

@@ -1,26 +1,21 @@ -Speedup Test::Unit + RSpec + Cucumber by running parallel on multiple CPUs (or cores).<br/> -ParallelTests splits tests into even groups(by number of tests or runtime) and runs each group in a single process with its own database. +Speedup Test::Unit + RSpec + Cucumber + Spinach by running parallel on multiple CPU cores.<br/> +ParallelTests splits tests into even groups (by number of lines or runtime) and runs each group in a single process with its own database. -[upgrading from 0.6 ?](https://github.com/grosser/parallel_tests/wiki/Upgrading-0.6.x-to-0.7.x) - Setup for Rails =============== [RailsCasts episode #413 Fast Tests](http://railscasts.com/episodes/413-fast-tests) -[still using Rails 2?](https://github.com/grosser/parallel_tests/blob/master/ReadmeRails2.md) ### Install -If you use RSpec: ensure you have >= 2.4 -As gem - ```ruby -# add to Gemfile +# Gemfile gem "parallel_tests", :group => :development ``` ### Add to `config/database.yml` + ParallelTests uses 1 database per test-process. <table> <tr><td>Process number</td><td>1</td><td>2</td><td>3</td></tr> <tr><td>`ENV['TEST_ENV_NUMBER']`</td><td>''</td><td>'2'</td><td>'3'</td></tr> </table> @@ -91,38 +86,44 @@ =================== Even test group run-times ------------------------- +### RSpec + Add the `RuntimeLogger` to log how long each test takes to run. This log file will be loaded on the next test run, and the tests will be grouped so that each process should finish around the same time. Rspec: Add to your `.rspec_parallel` (or `.rspec`) : --format progress --format ParallelTests::RSpec::RuntimeLogger --out tmp/parallel_runtime_rspec.log -Test::Unit: Add to your `test_helper.rb`: +### Test::Unit & Minitest 4 + +Add to your `test_helper.rb`: ```ruby require 'parallel_tests/test/runtime_logger' ``` +results will be logged to tmp/parallel_runtime_test.log + RSpec: SummaryLogger -------------------- -This logger logs the test output without the different processes overwriting each other. +Log the test output without the different processes overwriting each other. Add the following to your `.rspec_parallel` (or `.rspec`) : --format progress --format ParallelTests::RSpec::SummaryLogger --out tmp/spec_summary.log RSpec: FailuresLogger ----------------------- -This logger produces pasteable command-line snippets for each failed example. +Produce pasteable command-line snippets for each failed example. E.g. rspec /path/to/my_spec.rb:123 # should do something @@ -132,11 +133,11 @@ --format ParallelTests::RSpec::FailuresLogger --out tmp/failing_specs.log Cucumber: FailuresLogger ----------------------- -This logger logs failed cucumber scenarios to the specified file. The filename can be passed to cucumber, prefixed with '@' to rerun failures. +Log failed cucumber scenarios to the specified file. The filename can be passed to cucumber, prefixed with '@' to rerun failures. Usage: cucumber --format ParallelTests::Cucumber::FailuresLogger --out tmp/cucumber_failures.log @@ -146,14 +147,15 @@ Note if your `cucumber.yml` default profile uses `<%= std_opts %>` you may need to insert this as follows `parallel: <%= std_opts %> --format progress...` To rerun failures: - cucumber @tmp/cucumber_failures.log + cucumber @tmp/cucumber_failures.log Setup for non-rails =================== + gem install parallel_tests # go to your project dir parallel_test test/ parallel_rspec spec/ parallel_cucumber features/ @@ -208,40 +210,37 @@ </table> TIPS ==== - [RSpec] add a `.rspec_parallel` to use different options, e.g. **no --drb** - - [RSpec] delete `script/spec` - - [[Spork](https://github.com/sporkrb/spork)] does not work with parallel_tests except when using [sqlite in memory](https://github.com/grosser/parallel_tests/wiki#wiki-with-spork) - - [RSpec] remove --loadby from you spec/*.opts + - Spring does not work with parallel_tests, use `DISABLE_SPRING=1 rake parallel:spec` if you have spring hardcoded in your binaries + - [RSpec] remove `--loadby` from `.rspec` - [RSpec] Instantly see failures (instead of just a red F) with [rspec-instafail](https://github.com/grosser/rspec-instafail) - - [Bundler] if you have a `Gemfile` then `bundle exec` will be used to run tests - [Cucumber] add a `parallel: foo` profile to your `config/cucumber.yml` and it will be used to run parallel tests - - [Cucumber] Pass in cucumber options by not giving the options an identifier ex: `rake parallel:features[,,'cucumber_opts']` - [Capybara setup](https://github.com/grosser/parallel_tests/wiki) - [Sphinx setup](https://github.com/grosser/parallel_tests/wiki) - [Capistrano setup](https://github.com/grosser/parallel_tests/wiki/Remotely-with-capistrano) let your tests run on a big box instead of your laptop - [SQL schema format] use :ruby schema format to get faster parallel:prepare` - `export PARALLEL_TEST_PROCESSORS=X` in your environment and parallel_tests will use this number of processors by default - [ZSH] use quotes to use rake arguments `rake "parallel:prepare[3]"` - [email_spec and/or action_mailer_cache_delivery](https://github.com/grosser/parallel_tests/wiki) - - [Memcached] use different namespaces e.g. `config.cache_store = ..., :namespace => "test_#{ENV['TEST_ENV_NUMBER']}"` + - [Memcached] use different namespaces e.g. `config.cache_store = ..., namespace: "test_#{ENV['TEST_ENV_NUMBER']}"` - [zeus-parallel_tests](https://github.com/sevos/zeus-parallel_tests) - [Distributed parallel test (e.g. Travis Support)](https://github.com/grosser/parallel_tests/wiki/Distributed-Parallel-Tests-and-Travis-Support) + - Contribute your own gotaches to the [Wiki](https://github.com/grosser/parallel_tests/wiki) or even better open a PR :) TODO ==== - - make tests consistently pass with `--order random` in .rspec - fix tests vs cucumber >= 1.2 `unknown option --format` - add integration tests for the rake tasks, maybe generate a rails project ... - add unit tests for cucumber runtime formatter - make windows compatible Authors ==== inspired by [pivotal labs](http://pivotallabs.com/users/miked/blog/articles/849-parallelize-your-rspec-suite) -### [Contributors](http://github.com/grosser/parallel_tests/contributors) +### [Contributors](https://github.com/grosser/parallel_tests/contributors) - [Charles Finkel](http://charlesfinkel.com/) - [Indrek Juhkam](http://urgas.eu) - [Jason Morrison](http://jayunit.net) - [jinzhu](http://github.com/jinzhu) - [Joakim Kolsjö](http://www.rubyblocks.se)