Skip to content

test_runner: preserve literal directory arguments - #66778

Open
repzakske wants to merge 1 commit into
nodejs:mainfrom
repzakske:fix/test-runner-literal-directories
Open

repzakske wants to merge 1 commit into
nodejs:mainfrom
repzakske:fix/test-runner-literal-directories

Conversation

@repzakske

Copy link
Copy Markdown

An existing directory passed to node --test is expanded by appending the default test glob to its path. Glob metacharacters in the directory name then become active: node --test 'tests[1]' can skip its tests or run tests from a sibling named tests1.

Search from the directory itself so its path stays outside the glob pattern. Preserve explicit glob handling, node_modules filtering, and report paths, while de-duplicating overlapping selections.

Extend the existing CLI directory tests to cover bracket and brace names, trailing separators, and a sibling collision in both isolation modes.

Validation:

  • Built Node v27.0.0-pre from source on Linux x64 with GCC 14 and --v8-disable-temporal-support.
  • The CLI regression and all 84 remaining parallel/sequential test-runner files passed.
  • Repository ESLint passed for both changed files.

Assisted-by: Codex

@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

Review requested:

  • @nodejs/test_runner

@nodejs-github-bot nodejs-github-bot added needs-ci PRs that need a full CI run. test_runner Issues and PRs related to the test runner subsystem. labels Oct 16, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Welcome to Node.js, and thank you for your first contribution!

Before review, please take a moment to read:

Please make sure every commit is signed off. For a first pull request, GitHub Actions require collaborator approval and Jenkins CI must be started by a collaborator or triager, so an initial wait is normal.

Caution

AgentScan found account activity patterns that may be consistent with automation. This is a heuristic, not proof that this pull request was opened by an agent or violates policy. AI-assisted contributions are permitted, but automated tooling must not open pull requests without advance approval, and contributors must personally understand, test, verify, and take responsibility for every submitted change. See the AgentScan analysis, AI use policy, and automation policy for additional context.

Search existing directories with the directory as the glob cwd instead
of appending the default glob to the path. This prevents brackets and
braces in directory names from changing which tests are selected.

Preserve glob arguments, node_modules filtering, and report paths.
Deduplicate overlapping selections by their resolved paths.

Assisted-by: Codex
Signed-off-by: Casper Verbuyst <casperverbuyst@gmail.com>
@repzakske
repzakske force-pushed the fix/test-runner-literal-directories branch from 37d2026 to b4101a3 Compare October 16, 2026 02:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agentscan:automated-account needs-ci PRs that need a full CI run. test_runner Issues and PRs related to the test runner subsystem.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants