mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Address DEPRECATED: use MT_CPU instead of N for parallel test runs
* Steps to reproduce
```ruby
% cd actionpack
% N=0 bundle exec ruby -w -Itest test/controller/mime/accept_format_test.rb
DEPRECATED: use MT_CPU instead of N for parallel test runs
... snip ...
%
```
* minitest 5.12.0 deprecates ENV["N"] to specify number of parallel test
runners:
https://github.com/seattlerb/minitest/blob/master/History.rdoc#5120--2019-09-22
4103a10eb4
* No other code uses `ENV["N"]`
```
% git grep 'ENV\["N"\]'
actionpack/test/abstract_unit.rb: PROCESS_COUNT = (ENV["N"] || 4).to_i
%
```
* Rails guide suggests using `PARALLEL_WORKERS` to specify the number of workers, not `N`
https://guides.rubyonrails.org/testing.html#parallel-testing
https://guides.rubyonrails.org/testing.html#parallel-testing
```ruby
PARALLEL_WORKERS=15 rails test
```
This commit is contained in:
parent
f718ab6c72
commit
1a41a741cf
1 changed files with 1 additions and 1 deletions
|
@ -16,7 +16,7 @@ end
|
||||||
if ENV["TRAVIS"]
|
if ENV["TRAVIS"]
|
||||||
PROCESS_COUNT = 0
|
PROCESS_COUNT = 0
|
||||||
else
|
else
|
||||||
PROCESS_COUNT = (ENV["N"] || 4).to_i
|
PROCESS_COUNT = (ENV["MT_CPU"] || 4).to_i
|
||||||
end
|
end
|
||||||
|
|
||||||
require "active_support/testing/autorun"
|
require "active_support/testing/autorun"
|
||||||
|
|
Loading…
Reference in a new issue