Skip to content

test_runner: add initial CLI runner - #42658

Merged
nodejs-github-bot merged 1 commit into
nodejs:masterfrom
cjihrig:test-cli
Apr 15, 2022
Merged

nodejs-github-bot merged 1 commit into
nodejs:masterfrom
cjihrig:test-cli

Conversation

@cjihrig

@cjihrig cjihrig commented Apr 8, 2022

Copy link
Copy Markdown
Contributor

This commit introduces an initial version of a CLI-based test runner.

@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

Review requested:

  • @nodejs/startup

@nodejs-github-bot nodejs-github-bot added lib / src Issues and PRs involving general changes in the lib/ or src/ directories. needs-ci PRs that need a full CI run. labels Apr 8, 2022
Comment thread doc/api/test.md Outdated
Comment thread lib/internal/main/test_runner.js Outdated
Comment thread doc/api/test.md Outdated
Comment thread doc/api/test.md Outdated
Comment thread lib/internal/main/test_runner.js Outdated
Comment thread lib/internal/main/test_runner.js Outdated
Comment thread lib/internal/test_runner/tap_stream.js Outdated
@aduh95

aduh95 commented Apr 8, 2022

Copy link
Copy Markdown
Contributor

//cc @nodejs/test_runner

@richardlau richardlau added the semver-minor PRs that contain new features and should be released in the next minor version. label Apr 8, 2022

@ljharb ljharb left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread doc/api/test.md Outdated
Comment thread doc/api/test.md Outdated
Comment thread lib/internal/main/test_runner.js Outdated
Comment thread lib/internal/main/test_runner.js Outdated
Comment thread lib/internal/main/test_runner.js Outdated
Comment thread lib/internal/main/test_runner.js Outdated
Comment thread lib/internal/test_runner/utils.js Outdated
Comment thread lib/internal/test_runner/tap_stream.js Outdated
Comment thread lib/internal/main/test_runner.js Outdated
@richardlau

Copy link
Copy Markdown
Member

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?

As this PR currently is --test hasn't been added to the allow list for NODE_OPTIONS so setting it there would throw an error.

@ljharb

ljharb commented Apr 8, 2022

Copy link
Copy Markdown
Member

@richardlau thanks, if that's explicitly going to never be allowed there then that does mitigate that one concern, but all the others remain.