Skip to content
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

fix: exclude internal JS files from coverage #20448

Merged
merged 3 commits into from Sep 11, 2023

Conversation

marvinhagemeister
Copy link
Contributor

This PR changes the deno test --coverage=... behavior so that internal deno JS files are excluded.

Fixes #20447

@@ -127,6 +127,11 @@ impl CoverageCollector {

let script_coverages = self.take_precise_coverage().await?.result;
for script_coverage in script_coverages {
// Filter out internal JS files from being included in coverage reports
if script_coverage.url.starts_with("ext:") || script_coverage.url.starts_with("[ext:") {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

node: should also be excluded

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems like this is already happening because internally node:* is resolved to ext:deno_node/*. I'll add a test case for that regardless, because it's good to ensure that we don't regress on this 👍

Copy link
Member

@bartlomieju bartlomieju left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice fix 👍

@marvinhagemeister marvinhagemeister enabled auto-merge (squash) September 11, 2023 13:41
@marvinhagemeister marvinhagemeister merged commit 9d13858 into main Sep 11, 2023
13 checks passed
@marvinhagemeister marvinhagemeister deleted the no-internal-file-coverage branch September 11, 2023 13:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

deno test --coverage includes internal deno code
2 participants