From da9ae24d6cfed4d05edc4d4c03ad9679307762b4 Mon Sep 17 00:00:00 2001 From: Katsuya HIDAKA Date: Tue, 2 Jun 2026 11:50:19 +0900 Subject: Enable parallel tests only in test workflow --- .github/workflows/tests.yml | 3 +++ doc/RUNNING_TESTS | 5 ++--- test/application_system_test_case.rb | 2 -- test/test_helper.rb | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index ac1943d5e..8f6de5ed2 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -52,6 +52,9 @@ jobs: db-type: ${{ matrix.db }} ruby-version: ${{ matrix.ruby }} + - name: Enable parallel tests + run: echo "PARALLEL_WORKERS=$(nproc)" >> $GITHUB_ENV + - name: Run tests run: | bin/rails test diff --git a/doc/RUNNING_TESTS b/doc/RUNNING_TESTS index 8f63b38b1..166a82f10 100644 --- a/doc/RUNNING_TESTS +++ b/doc/RUNNING_TESTS @@ -14,9 +14,8 @@ 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. -Tests run in parallel by default, using the number of processors as the worker -count. You can change the worker count by setting the PARALLEL_WORKERS -environment variable: +You can run tests in parallel by setting the PARALLEL_WORKERS environment +variable: `PARALLEL_WORKERS=8 bin/rails test` Before running tests, you need to configure both development diff --git a/test/application_system_test_case.rb b/test/application_system_test_case.rb index 3deea4656..38d69e7c8 100644 --- a/test/application_system_test_case.rb +++ b/test/application_system_test_case.rb @@ -20,8 +20,6 @@ require_relative 'test_helper' class ApplicationSystemTestCase < ActionDispatch::SystemTestCase - parallelize(workers: 1) - DOWNLOADS_PATH = File.expand_path(File.join(Rails.root, 'tmp', 'downloads')) # Allow running Capybara default server on custom IP address and/or port diff --git a/test/test_helper.rb b/test/test_helper.rb index ec3e20c94..9dd387a22 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -50,7 +50,7 @@ class ActionView::TestCase end class ActiveSupport::TestCase - parallelize(workers: :number_of_processors) + parallelize(workers: 1) include ActionDispatch::TestProcess -- 2.51.0