From 96b5eb881a1a68121fb8e1fe99ffa064f19ffb6b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karl=20Erik=20=C3=95unapuu?= Date: Thu, 4 Jun 2020 12:36:17 +0300 Subject: [PATCH] Determine CPU count for parallelizing tests --- test/test_helper.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/test_helper.rb b/test/test_helper.rb index 3ab1e721d..fab712feb 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -43,7 +43,8 @@ EInvoice.provider = EInvoice::Providers::TestProvider.new class ActiveSupport::TestCase # Run tests in parallel with specified workers - parallelize(workers: :number_of_processors) + cpu_count = ENV['PARALLEL_WORKERS'] || Concurrent.physical_processor_count || 1 + parallelize(workers: cpu_count) ActiveRecord::Migration.check_pending! fixtures :all