test_runner: add initial CLI runner - #42658
Conversation
|
Review requested:
|
|
//cc @nodejs/test_runner |
ljharb
left a comment
There was a problem hiding this comment.
How does --test affect --require, or loaders? What happens to the REPL with node --test and no other arguments?
If NODE_OPTIONS='--test' is set, and the user doesn't control how node is invoked (via a shebang, for example), does this mean the user can never "undo" test mode?
This really feels to me like it should be an entirely distinct binary, rather than just a "mode" of the main node binary.
As this PR currently is |
|
@richardlau thanks, if that's explicitly going to never be allowed there then that does mitigate that one concern, but all the others remain. |
|
f3263c3 to
805361e
Compare
be14d2f to
a8c868e
Compare
There was a problem hiding this comment.
Just a question: why is this? I can definitely see wanting to run the inspector for debugging while running tests.
There was a problem hiding this comment.
A couple reasons:
- First, it's trivial to run an individual file with the inspector flags. At this point, the CLI runner is just spawning Node child processes with no special flags.
- Debugging through the CLI test runner is an awkward experience similar to the cluster module. Each test file will need a different debugger port. We would need to manage that logic as well as relay the correct information to users (I want to debug test X, I need to debug file Y, and connect to debug port Z). It also doesn't make sense to set something like
--inspect-brkon a bunch of child processes. - I looked at a couple test frameworks, and they didn't seem to have a great story around propagating inspector flags to test files.
- If someone is passionate about this, it can be added in the future. It just didn't seem worth it to me for an initial version given the previous points. I think it would make sense in the future to have configuration options for execArgv and argv of the child processes.
There was a problem hiding this comment.
Can we use chrome's debugger blackboxing stuff to "hide" the test runner code when inspecting?
There was a problem hiding this comment.
Possibly - I'm not sure though.
|
Landed in adaf602 |
This commit introduces an initial version of a CLI-based test runner. PR-URL: nodejs#42658 Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
This commit introduces an initial version of a CLI-based test runner. PR-URL: #42658 Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Notable changes: doc: * add @kuriyosh to collaborators (Yoshiki Kurihara) #42824 lib,src: * (SEMVER-MINOR) implement WebAssembly Web API (Tobias Nießen) #42701 test_runner: * (SEMVER-MINOR) add initial CLI runner (Colin Ihrig) #42658 worker: * (SEMVER-MINOR) add hasRef() to MessagePort (Darshan Sen) #42849 PR-URL: #42943
Notable changes: doc: * add @kuriyosh to collaborators (Yoshiki Kurihara) #42824 lib,src: * (SEMVER-MINOR) implement WebAssembly Web API (Tobias Nießen) #42701 test_runner: * (SEMVER-MINOR) add initial CLI runner (Colin Ihrig) #42658 worker: * (SEMVER-MINOR) add hasRef() to MessagePort (Darshan Sen) #42849 PR-URL: #42943
|
Who will extend the |
As always, the maintainers of https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node. |
This commit introduces an initial version of a CLI-based test runner. PR-URL: nodejs#42658 Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
This commit introduces an initial version of a CLI-based test runner. PR-URL: nodejs/node#42658 Backport-PR-URL: nodejs/node#43904 Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
This commit introduces an initial version of a CLI-based test runner.