-
-
Notifications
You must be signed in to change notification settings - Fork 35.4k
test_runner: fix support watch with run(), add globPatterns option #53866
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
70074ab
61675a0
5ed9505
895896f
37247a7
807e473
aaa0f99
fb8003d
95eae04
5f9b0a2
8eddb4e
d7ad6ee
51ec7e2
4a29e29
71df5bf
09785dc
182949d
c761443
d290029
9b164ab
82bf7f2
cdf2a03
bd7d8e2
689bd6d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
This reverts commit d7ad6ee.
- Loading branch information
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -8,6 +8,11 @@ import tmpdir from '../common/tmpdir.js'; | |
|
|
||
| const testFixtures = fixtures.path('test-runner'); | ||
|
|
||
| // This is needed, because calling run() with no files will | ||
| // load files matching from cwd, which includes all content of test/ | ||
| tmpdir.refresh(); | ||
| process.chdir(tmpdir.path); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Won't this break running the test suite in worker threads?
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Without this, I would need to fix #53867 as well in this PR. Let's see if it actually breaks something in CI.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 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.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think we still need to remove this.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ok. I'll need to add a
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would hold off on adding a |
||
|
|
||
| describe('require(\'node:test\').run', { concurrency: true }, () => { | ||
| it('should run with no tests', async () => { | ||
| const stream = run({ files: [] }); | ||
|
|
@@ -504,9 +509,7 @@ describe('require(\'node:test\').run', { concurrency: true }, () => { | |
| }); | ||
|
|
||
| it('should run with no files', async () => { | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should these tests be removed? Shouldn't these still work the same?
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Unfortunately they will now fail as they are trying to load all files in |
||
| tmpdir.refresh(); | ||
| const stream = run({ | ||
| cwd: tmpdir.path, | ||
| files: undefined | ||
| }).compose(tap); | ||
| stream.on('test:fail', common.mustNotCall()); | ||
|
|
@@ -517,9 +520,7 @@ describe('require(\'node:test\').run', { concurrency: true }, () => { | |
| }); | ||
|
|
||
| it('should run with no files and use spec reporter', async () => { | ||
| tmpdir.refresh(); | ||
| const stream = run({ | ||
| cwd: tmpdir.path, | ||
| files: undefined | ||
| }).compose(spec); | ||
| stream.on('test:fail', common.mustNotCall()); | ||
|
|
@@ -530,9 +531,7 @@ describe('require(\'node:test\').run', { concurrency: true }, () => { | |
| }); | ||
|
|
||
| it('should run with no files and use dot reporter', async () => { | ||
| tmpdir.refresh(); | ||
| const stream = run({ | ||
| cwd: tmpdir.path, | ||
| files: undefined | ||
| }).compose(dot); | ||
| stream.on('test:fail', common.mustNotCall()); | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.