Skip to content

test_runner: exclude test files from coverage by default#56060

Merged
nodejs-github-bot merged 5 commits intonodejs:mainfrom
pmarchini:issue/53508
Dec 17, 2024
Merged

test_runner: exclude test files from coverage by default#56060
nodejs-github-bot merged 5 commits intonodejs:mainfrom
pmarchini:issue/53508

Conversation

@pmarchini
Copy link
Copy Markdown
Member

This should address #53508.

I'm opening this PR since #55633 seems to be stale.

This PR contains the feature and some changes to reduce its footprint.

Note: The reason behind lazyMinimatch is to avoid experimental warnings related to matchesGlob.

I'm not entirely convinced about the change I introduced to the --test-coverage-exclude and --test-coverage-include flags.

Regarding:
@cjihrig
#55633 (review)

Another thing that is not clear to me: what happens if someone runs a test file, but that test file imports another file that also includes tests? Should we exclude that imported file from the coverage report, or should we only exclude the files that the user specified?

I think we should just exclude the files specified by the user, as it's the most common scenario.
If a user imports other tests from different files, I would expect them to exclude those manually.
WDYT?

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

Labels

author ready PRs that have at least one approval, no pending requests for changes, and a CI started. backport-requested-v22.x PRs awaiting manual backport to the v22.x-staging branch. commit-queue-squash Add this label to instruct the Commit Queue to squash all the PR commits into the first one. 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.

8 participants