Skip to content

Commit f07d766

Browse files
marco-ippolitoaduh95
authored andcommitted
src: rename config file testRunner to test
PR-URL: #60798 Backport-PR-URL: #63659 Signed-off-by: Marco Ippolito <[email protected]> Reviewed-By: Antoine du Hamel <[email protected]>
1 parent b459d10 commit f07d766

17 files changed

Lines changed: 58 additions & 29 deletions

β€Ždoc/api/cli.mdβ€Ž

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -987,7 +987,7 @@ in the `$schema` must be replaced with the version of Node.js you are using or
987987
"watch-path": "src",
988988
"watch-preserve-output": true
989989
},
990-
"testRunner": {
990+
"test": {
991991
"test-isolation": "process"
992992
},
993993
"watch": {
@@ -1000,7 +1000,7 @@ The configuration file supports namespace-specific options:
10001000

10011001
* The `nodeOptions` field contains CLI flags that are allowed in [`NODE_OPTIONS`][].
10021002

1003-
* Namespace fields like `testRunner` contain configuration specific to that subsystem.
1003+
* Namespace fields like `test` contain configuration specific to that subsystem.
10041004

10051005
No-op flags are not supported.
10061006
Not all V8 flags are currently supported.

β€Ždoc/node-config-schema.jsonβ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -816,7 +816,7 @@
816816
}
817817
}
818818
},
819-
"testRunner": {
819+
"test": {
820820
"type": "object",
821821
"additionalProperties": false,
822822
"required": [],

β€Žsrc/node_config_file.ccβ€Ž

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -260,8 +260,20 @@ ParseResult ConfigReader::ParseConfig(const std::string_view& config_path) {
260260
return ParseResult::InvalidContent;
261261
}
262262

263-
// Check if this field is a valid namespace
264263
std::string namespace_name(field_name);
264+
265+
// TODO(@marco-ippolito): Remove warning for testRunner namespace
266+
if (namespace_name == "testRunner") {
267+
FPrintF(stderr,
268+
"the \"testRunner\" namespace has been removed. "
269+
"Use \"test\" instead.\n");
270+
// Better to throw an error than to ignore it
271+
// Otherwise users might think their test suite is green
272+
// when it's not running
273+
return ParseResult::InvalidContent;
274+
}
275+
276+
// Check if this field is a valid namespace
265277
if (!valid_namespaces.contains(namespace_name)) {
266278
// If not, skip it
267279
continue;

β€Žsrc/node_options.hβ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -429,7 +429,7 @@ std::vector<std::string> MapAvailableNamespaces();
429429
// Define all namespace entries
430430
#define OPTION_NAMESPACE_LIST(V) \
431431
V(kNoNamespace, "") \
432-
V(kTestRunnerNamespace, "testRunner") \
432+
V(kTestRunnerNamespace, "test") \
433433
V(kWatchNamespace, "watch") \
434434
V(kPermissionNamespace, "permission")
435435

β€Žtest/fixtures/options-as-flags/test-config.jsonβ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"experimental-transform-types": true,
44
"max-http-header-size": 8192
55
},
6-
"testRunner": {
6+
"test": {
77
"test-isolation": "none"
88
}
99
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"testRunner": {
3+
"test-isolation": "none"
4+
}
5+
}

β€Žtest/fixtures/rc/duplicate-namespace-option/node.config.jsonβ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"testRunner": {
2+
"test": {
33
"test-name-pattern": "first-pattern",
44
"test-name-pattern": "second-pattern"
55
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
"testRunner": {}
2+
"test": {}
33
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"testRunner": {
2+
"test": {
33
"test-coverage-exclude": ["config-pattern1", "config-pattern2"]
44
}
55
}

β€Žtest/fixtures/rc/namespace-with-disallowed-envvar.jsonβ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"testRunner": {
2+
"test": {
33
"test-concurrency": 1,
44
"experimental-test-coverage": true
55
}

0 commit comments

Comments
Β (0)