From bd31345c87f8d19a98edb5977507bc8f76da1688 Mon Sep 17 00:00:00 2001 From: Go MAEDA Date: Tue, 6 Apr 2021 06:27:42 +0000 Subject: [PATCH] Allow parallel testing (#35030). Patch by Go MAEDA. git-svn-id: http://svn.redmine.org/redmine/trunk@20920 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- doc/RUNNING_TESTS | 4 ++++ test/test_helper.rb | 2 ++ 2 files changed, 6 insertions(+) diff --git a/doc/RUNNING_TESTS b/doc/RUNNING_TESTS index 35e271a34..fa4737e11 100644 --- a/doc/RUNNING_TESTS +++ b/doc/RUNNING_TESTS @@ -14,6 +14,10 @@ Apache perl module Redmine.pm and Capybara tests, see below). You can run `ruby test/unit/issue_test.rb` for running a single test case and `ruby test/unit/issue_test.rb -n test_create` for running a single test. +You can run tests in parallel by setting the PARALLEL_WORKERS environment +variable: +`PARALLEL_WORKERS=8 rake test` + Before running tests, you need to configure both development and test databases. diff --git a/test/test_helper.rb b/test/test_helper.rb index 10f4f6e35..95b877d44 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -53,6 +53,8 @@ class ActionView::TestCase end class ActiveSupport::TestCase + parallelize(workers: 1) + include ActionDispatch::TestProcess self.use_transactional_tests = true