Determine CPU count for parallelizing tests

This commit is contained in:
Karl Erik Õunapuu 2020-06-04 12:36:17 +03:00
parent fbaf439dc2
commit 96b5eb881a

View file

@ -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