Skip to content

Commit 060c851

Browse files
committed
test_runner: introduces test_concurrency flag
adds the test_concurrency flag, if set to true, runs all the tests in parallel Fixes: nodejs#43837
1 parent 7ef069e commit 060c851

File tree

4 files changed

+12
-1
lines changed

4 files changed

+12
-1
lines changed

doc/api/cli.md

+8
Original file line numberDiff line numberDiff line change
@@ -1116,6 +1116,14 @@ Starts the Node.js command line test runner. This flag cannot be combined with
11161116
`--check`, `--eval`, `--interactive`, or the inspector. See the documentation
11171117
on [running tests from the command line][] for more details.
11181118

1119+
### `--test-concurrency`
1120+
1121+
<!-- YAML
1122+
added: REPLACEME
1123+
-->
1124+
1125+
Configures the test runner to run sub tests in parallel.
1126+
11191127
### `--test-only`
11201128

11211129
<!-- YAML

lib/internal/test_runner/test.js

-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@ const isTestRunner = getOptionValue('--test');
4848
const testOnlyFlag = !isTestRunner && getOptionValue('--test-only');
4949
// TODO(cjihrig): Use uv_available_parallelism() once it lands.
5050
const rootConcurrency = isTestRunner ? cpus().length : 1;
51-
5251
const kShouldAbort = Symbol('kShouldAbort');
5352

5453

src/node_options.cc

+3
Original file line numberDiff line numberDiff line change
@@ -529,6 +529,9 @@ EnvironmentOptionsParser::EnvironmentOptionsParser() {
529529
AddOption("--test",
530530
"launch test runner on startup",
531531
&EnvironmentOptions::test_runner);
532+
AddOption("--test-concurrency",
533+
"tests defined within a file run in parallel",
534+
&EnvironmentOptions::test_concurrency);
532535
AddOption("--test-only",
533536
"run tests with 'only' option set",
534537
&EnvironmentOptions::test_only,

src/node_options.h

+1
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,7 @@ class EnvironmentOptions : public Options {
151151
std::string redirect_warnings;
152152
std::string diagnostic_dir;
153153
bool test_runner = false;
154+
bool test_concurrency = false;
154155
bool test_only = false;
155156
bool test_udp_no_try_send = false;
156157
bool throw_deprecation = false;

0 commit comments

Comments
 (0)