rails--rails/railties
Jorge Manrubia ecc5afed30 Parallelize tests only when overhead is justified
Parallelizing tests has a cost in terms of database setup and fixture
loading. This change makes Rails disable parallelization when the number
of tests is below a configurable threshold.

When running tests in parallel each process gets its own database
instance. On each execution, each process will update each database
schema (if needed) and load all the fixtures. This can be very expensive
for non trivial datasets.

As an example, for HEY, when running a single file with 18 tests,
running tests in parallel in my box adds an overhead of 13 seconds
versus not parallelizing them. Of course parallelizing is totally worthy
when there are many tests to run, but not when running just a few tests.

The threshold is configurable via
config.active_support.test_parallelization_minimum_number_of_tests,
which is 30 50 by default.

This also adds some tracing to know how tests are being executed:

When in parallel:

```
Running 2829 tests in parallel in 8 processes
```

When not in parallel:

```
Running 15 tests in a single process (parallelization threshold is 30)
```
2021-07-14 13:36:28 +02:00
..
bin
exe
lib Removes unnecessary calls to zeitwerk_enabled? 2021-07-11 22:40:23 +02:00
test Parallelize tests only when overhead is justified 2021-07-14 13:36:28 +02:00
.gitignore
CHANGELOG.md 💅 complete sentence in railties/CHANGELOG 2021-07-07 08:20:18 +09:00
MIT-LICENSE Bump license years to 2021 [ci skip] 2021-01-01 12:21:20 +09:00
RDOC_MAIN.rdoc [ci skip] Fix broken links on RDOC_MAIN.rdoc 2021-04-30 09:22:28 +02:00
README.rdoc Fix grammar mistakes [ci skip] 2021-04-10 22:15:52 -05:00
Rakefile
railties.gemspec Make sure the version of rake used in Rails apps work 2021-03-15 20:48:38 +00:00

README.rdoc

= Railties -- Gluing the Engine to the Rails

Railties is responsible for gluing all frameworks together. Overall, it:

* handles the bootstrapping process for a Rails application;

* manages the +rails+ command line interface;

* and provides the Rails generators core.

== Download

The latest version of Railties can be installed with RubyGems:

* gem install railties

Source code can be downloaded as part of the Rails project on GitHub

* https://github.com/rails/rails/tree/main/railties

== License

Railties is released under the MIT license:

* https://opensource.org/licenses/MIT

== Support

API documentation is at

* https://api.rubyonrails.org

Bug reports can be filed for the Ruby on Rails project here:

* https://github.com/rails/rails/issues

Feature requests should be discussed on the rails-core mailing list here:

* https://discuss.rubyonrails.org/c/rubyonrails-core