-
Notifications
You must be signed in to change notification settings - Fork 29.6k
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
test_runner: make --test-name-pattern
recursive
#48382
test_runner: make --test-name-pattern
recursive
#48382
Conversation
Review requested:
|
I am not sure if this should be smver-major |
Arguably this is a bug fix so II don't think it needs semver-major |
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.
As this is currently written, I do believe it's a breaking change. I'm more concerned that I don't think this is the right change based on what is being requested in #46728.
@@ -5,7 +5,7 @@ const { test } = require('node:test'); | |||
|
|||
test('enabled and only', { only: true }, common.mustCall(async (t) => { | |||
await t.test('enabled', common.mustCall()); | |||
await t.test('disabled', common.mustNotCall()); | |||
await t.test('disabled but parent not', common.mustCall()); |
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.
Why is this running? Is it because the parent is enabled? If so, I don't think that's what #46728 is about.
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.
see #48382 (comment)
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.
FWIW, this change corresponds to my expectations.
A more realistic use case:
describe('add', () => {
it('should return 2', () => assert.strictEqual(add(1, 1), 2));
it('should return 10', () => assert.strictEqual(add(8, 2), 10));
it('should throw', () => assert.throws(() => add(), TypeError));
});
describe('subtract', () => {
// ...
});
node --test-name-pattern=add
should run all children of describe('add')
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'm fine with this PR now that it's clear this is not fixing #46728.
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.
Can you please approve? :)
I remove the link between this PR and that issue. |
Commit Queue failed- Loading data for nodejs/node/pull/48382 ✔ Done loading data for nodejs/node/pull/48382 ----------------------------------- PR info ------------------------------------ Title test_runner: make `--test-name-pattern` recursive (#48382) Author Moshe Atlow (@MoLow) Branch MoLow:filter-by-name-recursive -> nodejs:main Labels author ready, needs-ci, test_runner Commits 2 - test_runner: make `--test-name-pattern` recursive - CR Committers 1 - Moshe Atlow PR-URL: https://github.com/nodejs/node/pull/48382 Reviewed-By: Benjamin Gruenbaum Reviewed-By: Colin Ihrig ------------------------------ Generated metadata ------------------------------ PR-URL: https://github.com/nodejs/node/pull/48382 Reviewed-By: Benjamin Gruenbaum Reviewed-By: Colin Ihrig -------------------------------------------------------------------------------- ℹ This PR was created on Wed, 07 Jun 2023 19:06:09 GMT ✔ Approvals: 2 ✔ - Benjamin Gruenbaum (@benjamingr): https://github.com/nodejs/node/pull/48382#pullrequestreview-1469507668 ✔ - Colin Ihrig (@cjihrig) (TSC): https://github.com/nodejs/node/pull/48382#pullrequestreview-1473725491 ✔ Last GitHub CI successful ℹ Last Full PR CI on 2023-06-09T13:01:22Z: https://ci.nodejs.org/job/node-test-pull-request/52180/ - Querying data for job/node-test-pull-request/52180/ ✔ Last Jenkins CI successful -------------------------------------------------------------------------------- ✔ No git cherry-pick in progress ✔ No git am in progress ✔ No git rebase in progress -------------------------------------------------------------------------------- - Bringing origin/main up to date... From https://github.com/nodejs/node * branch main -> FETCH_HEAD ✔ origin/main is now up-to-date - Downloading patch for 48382 From https://github.com/nodejs/node * branch refs/pull/48382/merge -> FETCH_HEAD ✔ Fetched commits as 4ee8ef269ba4..fb4215b79bc6 -------------------------------------------------------------------------------- [main beee13d595] test_runner: make `--test-name-pattern` recursive Author: Moshe Atlow Date: Wed Jun 7 22:04:02 2023 +0300 5 files changed, 124 insertions(+), 31 deletions(-) [main 233e2f5161] CR Author: Moshe Atlow Date: Fri Jun 9 06:45:43 2023 +0300 2 files changed, 13 insertions(+), 13 deletions(-) ✔ Patches applied There are 2 commits in the PR. Attempting autorebase. Rebasing (2/4)https://github.com/nodejs/node/actions/runs/5236052142 |
Landed in c21fe3a |
PR-URL: #48382 Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
PR-URL: nodejs#48382 Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
PR-URL: nodejs#48382 Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
PR-URL: #48382 Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Refs: #46728 (comment)