Skip to content

test_runner: match coverage globs against cwd-relative paths#62362

Open
ace-tk wants to merge 1 commit intonodejs:mainfrom
ace-tk:fix/test-runner-coverage-relative-globs
Open

test_runner: match coverage globs against cwd-relative paths#62362
ace-tk wants to merge 1 commit intonodejs:mainfrom
ace-tk:fix/test-runner-coverage-relative-globs

Conversation

@ace-tk
Copy link

@ace-tk ace-tk commented Mar 21, 2026

Summary

  • apply coverage include/exclude glob matching using cwd-relative paths only
  • avoid accidentally excluding files when absolute parent directories contain names like test
  • add a regression test for default coverage exclusion with cwd containing a test directory segment

Test plan

  • not run in this environment (no local Node core build)
  • run: python3 tools/test.py test/parallel/test-runner-coverage-default-exclusion.mjs

Closes: #58654

Avoid applying coverage include/exclude glob checks to absolute paths so projects under directories named like test/ are not accidentally excluded. Add a regression test for cwd paths containing test.

Made-with: Cursor
@nodejs-github-bot
Copy link
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 Mar 21, 2026
@avivkeller
Copy link
Member

Ref on why this approach was chosen originally (by me): #53553 (comment)

@ace-tk
Copy link
Author

ace-tk commented Mar 21, 2026

@avivkeller

My goal was to prevent unexpected exclusions caused by absolute parent paths containing test. If changing this behavior is not preferred, I can close this and submit a docs-only clarification PR instead. Happy to follow your preferred direction.

@avivkeller
Copy link
Member

cc @nodejs/test_runner

@ace-tk
Copy link
Author

ace-tk commented Mar 21, 2026

@avivkeller Thanks for the context and for cc-ing @nodejs/test_runner.

My intent was to avoid surprising exclusions when absolute parent paths contain test, but I understand this may conflict with the original design tradeoff in #53553

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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.

--experimental-test-coverage empty since 23.5.0

3 participants