From 1a41a741cf5bc1b5d4038f999bacaec2a7b297dc Mon Sep 17 00:00:00 2001 From: Yasuo Honda Date: Sat, 28 Dec 2019 12:39:37 +0900 Subject: [PATCH] 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 https://github.com/seattlerb/minitest/commit/4103a10eb4bb99bc60721b3245ee3a69988a214b * 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 ``` --- actionpack/test/abstract_unit.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/actionpack/test/abstract_unit.rb b/actionpack/test/abstract_unit.rb index eb66876c3f..cf628f11db 100644 --- a/actionpack/test/abstract_unit.rb +++ b/actionpack/test/abstract_unit.rb @@ -16,7 +16,7 @@ end if ENV["TRAVIS"] PROCESS_COUNT = 0 else - PROCESS_COUNT = (ENV["N"] || 4).to_i + PROCESS_COUNT = (ENV["MT_CPU"] || 4).to_i end require "active_support/testing/autorun"