Uh oh!
There was an error while loading. Please reload this page.
test_runner: fix support watch with run(), add globPatterns option - #53866
Conversation
nodejs-github-bot
commented
Jul 16, 2024
Review requested:
|
There was a problem hiding this comment.
Won't this break running the test suite in worker threads?
There was a problem hiding this comment.
Without this, I would need to fix #53867 as well in this PR.
Let's see if it actually breaks something in CI.
There was a problem hiding this comment.
It looks like it did break in the CI (https://ci.nodejs.org/job/node-test-commit-custom-suites-freestyle/37045/). The issue is that the Node test suite is run within a worker thread in the CI. Any test that uses an API that is unsupported in worker threads needs to be skipped there.
There was a problem hiding this comment.
I think we still need to remove this.
There was a problem hiding this comment.
Ok. I'll need to add a cwd parameter to run(), otherwise it won't work.
There was a problem hiding this comment.
I would hold off on adding a cwd parameter for now, but I do foresee us adding it in the future. I'm just not sure if it will break anything until the necessary refactoring happens. Another option is to spawn a child process with the correct cwd.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
nodejs-github-bot
commented
Jul 16, 2024
mcollina
commented
Jul 16, 2024
@cjihrig@MoLow can you tell me why this is trying to load |
cjihrig
commented
Jul 16, 2024
My guess is because the Python test runner uses it and the |
mcollina
commented
Jul 16, 2024
I guess it's #53867 at play. |
cjihrig
commented
Jul 16, 2024
Yep. But also, the Python runner should probably not use a relative path like that. |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
It looks like this is not addressed.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
mcollina
commented
Jul 18, 2024
@cjihrig@atlowChemi@MoLow PTAL, all reviews should have been handled. |
nodejs-github-bot
commented
Jul 18, 2024
There was a problem hiding this comment.
I think we still need to remove this.
There was a problem hiding this comment.
It looks like this is not addressed.
There was a problem hiding this comment.
We should probably validate that the array is not empty. You can add the logic here. Otherwise, I will probably do it in a follow up.
There was a problem hiding this comment.
I would assign the default patterns in the run() validation. You can do that in this PR, otherwise, I will probably do it in a follow up.
nodejs-github-bot
commented
Jul 18, 2024
nodejs-github-bot
commented
Jul 18, 2024
Can someone help me with this? I see no conflicts locally but CI does: https://ci.nodejs.org/job/node-test-commit/72259/console. Was by any chance a force push broke something? |
Signed-off-by: Matteo Collina <hello@matteocollina.com>
nodejs-github-bot
commented
Jul 23, 2024
nodejs-github-bot
commented
Jul 24, 2024
nodejs-github-bot
commented
Jul 24, 2024
nodejs-github-bot
commented
Jul 24, 2024
Landed in 2208948 |
This commit updates the test runner's code coverage so that coverage options are explicitly passed in instead of pulled from command line options. PR-URL: #53931 Refs: #53924 Refs: #53867 Refs: #53866 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Moshe Atlow <moshe@atlow.co.il> Reviewed-By: Chemi Atlow <chemi@atlow.co.il> Reviewed-By: James M Snell <jasnell@gmail.com>
Signed-off-by: Matteo Collina <hello@matteocollina.com> PR-URL: #53866 Reviewed-By: Chemi Atlow <chemi@atlow.co.il> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
Notable changes: deps: * (SEMVER-MINOR) V8: backport 7857eb34db42 (Stephen Belanger) #53997 http: * (SEMVER-MINOR) add diagnostics channel `http.client.request.error` (Kohei Ueno) #54054 inspector: * (SEMVER-MINOR) add initial support for network inspection (Kohei Ueno) #53593 lib,src: * drop --experimental-network-imports (Rafael Gonzaga) #53822 meta: * add jake to collaborators (jakecastelli) #54004 module: * (SEMVER-MINOR) add --experimental-strip-types (Marco Ippolito) #53725 * (SEMVER-MINOR) unflag detect-module (Geoffrey Booth) #53619 stream: * (SEMVER-MINOR) expose DuplexPair API (Austin Wright) #34111 test_runner: * (SEMVER-MINOR) fix support watch with run(), add globPatterns option (Matteo Collina) #53866 * (SEMVER-MINOR) refactor snapshots to get file from context (Colin Ihrig) #53853 * (SEMVER-MINOR) add context.filePath (Colin Ihrig) #53853 PR-URL: #54123
This commit updates the test runner's code coverage so that coverage options are explicitly passed in instead of pulled from command line options. PR-URL: #53931 Refs: #53924 Refs: #53867 Refs: #53866 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Moshe Atlow <moshe@atlow.co.il> Reviewed-By: Chemi Atlow <chemi@atlow.co.il> Reviewed-By: James M Snell <jasnell@gmail.com>
Signed-off-by: Matteo Collina <hello@matteocollina.com> PR-URL: #53866 Reviewed-By: Chemi Atlow <chemi@atlow.co.il> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
Notable changes: deps: * (SEMVER-MINOR) V8: backport 7857eb34db42 (Stephen Belanger) #53997 http: * (SEMVER-MINOR) add diagnostics channel `http.client.request.error` (Kohei Ueno) #54054 inspector: * (SEMVER-MINOR) add initial support for network inspection (Kohei Ueno) #53593 lib,src: * drop --experimental-network-imports (Rafael Gonzaga) #53822 meta: * add jake to collaborators (jakecastelli) #54004 module: * (SEMVER-MINOR) add --experimental-strip-types (Marco Ippolito) #53725 stream: * (SEMVER-MINOR) expose DuplexPair API (Austin Wright) #34111 test_runner: * (SEMVER-MINOR) fix support watch with run(), add globPatterns option (Matteo Collina) #53866 * (SEMVER-MINOR) refactor snapshots to get file from context (Colin Ihrig) #53853 * (SEMVER-MINOR) add context.filePath (Colin Ihrig) #53853 PR-URL: #54123
Notable changes: deps: * (SEMVER-MINOR) V8: backport 7857eb34db42 (Stephen Belanger) #53997 http: * (SEMVER-MINOR) add diagnostics channel `http.client.request.error` (Kohei Ueno) #54054 inspector: * (SEMVER-MINOR) add initial support for network inspection (Kohei Ueno) #53593 lib,src: * drop --experimental-network-imports (Rafael Gonzaga) #53822 meta: * add jake to collaborators (jakecastelli) #54004 module: * (SEMVER-MINOR) add --experimental-strip-types (Marco Ippolito) #53725 stream: * (SEMVER-MINOR) expose DuplexPair API (Austin Wright) #34111 test_runner: * (SEMVER-MINOR) fix support watch with run(), add globPatterns option (Matteo Collina) #53866 * (SEMVER-MINOR) refactor snapshots to get file from context (Colin Ihrig) #53853 * (SEMVER-MINOR) add context.filePath (Colin Ihrig) #53853 PR-URL: #54123
This PR fixes one regression I found when using
run({ watch: true }): a different test was run after a file rename.This was caused by calling
createTestFileList()from thechangedevent handler innode/lib/internal/test_runner/runner.js
Line 423 in 362afa5
The problem is that
createTestFileList()was loading the glob pattern fromargv, which can be whatever. The result was but that was very hard to track.This PR includes:
run({ watch: true })globPatternsthat will allow users to control whatrun()will be globbing