Patch #44116 » 0001-Enable-parallel-tests-only-in-test-workflow.patch
| .github/workflows/tests.yml | ||
|---|---|---|
|
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
|
||
| doc/RUNNING_TESTS | ||
|---|---|---|
|
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
|
||
| test/application_system_test_case.rb | ||
|---|---|---|
|
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
|
||
| test/test_helper.rb | ||
|---|---|---|
|
end
|
||
|
class ActiveSupport::TestCase
|
||
|
parallelize(workers: :number_of_processors)
|
||
|
parallelize(workers: 1)
|
||
|
include ActionDispatch::TestProcess
|
||
- « Previous
- 1
- 2
- 3
- 4
- Next »