From 9f9c58212eb0a4b560749ddc8875f4a558342f64 Mon Sep 17 00:00:00 2001 From: cjihrig Date: Sun, 1 Oct 2023 11:46:14 -0400 Subject: [PATCH] test_runner, cli: add --test-concurrency flag This commit adds a new --test-concurrency CLI flag that controls the parallelism of the test runner CLI. PR-URL: https://github.com/nodejs/node/pull/49996 Fixes: https://github.com/nodejs/node/issues/49487 Reviewed-By: Matteo Collina Reviewed-By: Moshe Atlow Reviewed-By: Benjamin Gruenbaum Reviewed-By: Chemi Atlow --- doc/api/cli.md | 9 ++++ doc/api/test.md | 12 +++--- doc/node.1 | 4 ++ lib/internal/main/test_runner.js | 2 +- src/node_options.cc | 3 ++ src/node_options.h | 1 + test/parallel/test-runner-cli-concurrency.js | 45 ++++++++++++++++++++ 7 files changed, 70 insertions(+), 6 deletions(-) create mode 100644 test/parallel/test-runner-cli-concurrency.js diff --git a/doc/api/cli.md b/doc/api/cli.md index 8e41de3d8ebc82..a2ea069322a901 100644 --- a/doc/api/cli.md +++ b/doc/api/cli.md @@ -1654,6 +1654,15 @@ Starts the Node.js command line test runner. This flag cannot be combined with See the documentation on [running tests from the command line][] for more details. +### `--test-concurrency` + + + +The maximum number of test files that the test runner CLI will execute +concurrently. The default value is `os.availableParallelism() - 1`. + ### `--test-name-pattern`