From 219b900384d63dfe3cdc8df4bf1e66b45e7d5988 Mon Sep 17 00:00:00 2001 From: Colin Ihrig Date: Thu, 19 Dec 2024 21:10:26 -0500 Subject: [PATCH] test_runner,cli: mark test isolation as stable This commit stabilizes test isolation configuration in the test runner. PR-URL: https://github.com/nodejs/node/pull/56298 Reviewed-By: Yagiz Nizipli Reviewed-By: Matteo Collina Reviewed-By: Moshe Atlow Reviewed-By: Pietro Marchini Reviewed-By: Chemi Atlow Reviewed-By: Jake Yuesong Li --- doc/api/cli.md | 37 +++++++++++-------- doc/node.1 | 6 +-- lib/internal/test_runner/utils.js | 2 +- src/node_options.cc | 10 +++-- test/parallel/test-runner-cli-concurrency.js | 4 +- test/parallel/test-runner-cli-timeout.js | 2 +- test/parallel/test-runner-cli.js | 18 ++++----- test/parallel/test-runner-coverage.js | 2 +- .../test-runner-extraneous-async-activity.js | 2 +- .../test-runner-force-exit-failure.js | 2 +- .../test-runner-no-isolation-filtering.js | 8 ++-- .../test-runner-no-isolation-hooks.mjs | 2 +- test/parallel/test-runner-snapshot-tests.js | 6 +-- test/parallel/test-runner-watch-mode.mjs | 2 +- 14 files changed, 55 insertions(+), 48 deletions(-) diff --git a/doc/api/cli.md b/doc/api/cli.md index 3a8e278df68f36..422ee7b61d686e 100644 --- a/doc/api/cli.md +++ b/doc/api/cli.md @@ -1025,20 +1025,6 @@ generated as part of the test runner output. If no tests are run, a coverage report is not generated. See the documentation on [collecting code coverage from tests][] for more details. -### `--experimental-test-isolation=mode` - - - -> Stability: 1.0 - Early development - -Configures the type of test isolation used in the test runner. When `mode` is -`'process'`, each test file is run in a separate child process. When `mode` is -`'none'`, all test files run in the same process as the test runner. The default -isolation mode is `'process'`. This flag is ignored if the `--test` flag is not -present. See the [test runner execution model][] section for more information. - ### `--experimental-test-module-mocks` The maximum number of test files that the test runner CLI will execute -concurrently. If `--experimental-test-isolation` is set to `'none'`, this flag -is ignored and concurrency is one. Otherwise, concurrency defaults to +concurrently. If `--test-isolation` is set to `'none'`, this flag is ignored and +concurrency is one. Otherwise, concurrency defaults to `os.availableParallelism() - 1`. ### `--test-coverage-branches=threshold` @@ -2323,6 +2309,23 @@ added: Configures the test runner to exit the process once all known tests have finished executing even if the event loop would otherwise remain active. +### `--test-isolation=mode` + + + +Configures the type of test isolation used in the test runner. When `mode` is +`'process'`, each test file is run in a separate child process. When `mode` is +`'none'`, all test files run in the same process as the test runner. The default +isolation mode is `'process'`. This flag is ignored if the `--test` flag is not +present. See the [test runner execution model][] section for more information. + ### `--test-name-pattern`