Skip to content

fix(selectivity): include browser function-less files#1219

Merged
KuznetsovRoman merged 1 commit intomasterfrom
TESTPLANE-936.file_coverage
Mar 18, 2026
Merged

fix(selectivity): include browser function-less files#1219
KuznetsovRoman merged 1 commit intomasterfrom
TESTPLANE-936.file_coverage

Conversation

@KuznetsovRoman
Copy link
Member

No description provided.

@pkg-pr-new
Copy link

pkg-pr-new bot commented Mar 12, 2026

Open in StackBlitz

npm i https://pkg.pr.new/gemini-testing/testplane@1219

commit: 60def12

sourceString,
sourceMapsString,
Array.from(startOffsetsSet),
grouppedByScriptCoverage[scriptId],
Copy link
Member Author

Choose a reason for hiding this comment

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

Now passing full coverage, with ranges
Ranges are necessary to perform source map function bounds checking

const previousPosition = consumer.originalPositionFor({
line: startLine + 1,
column,
bias: SourceMapConsumer.GREATEST_LOWER_BOUND,
Copy link
Member Author

Choose a reason for hiding this comment

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

With "GREATEST_LOWER_BOUND" bias (which is default) we might get position, before the actual function
So after calling "generatedPositionFor" we check generatedPosition.line >= startLine + 1 which ensures "source map is in function boundaries"

break;
}

(previousPosition as SourceFindPosition).bias = SourceMapConsumer.GREATEST_LOWER_BOUND;
Copy link
Member Author

Choose a reason for hiding this comment

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

Reusing "previousPosition" object

const nextPosition = consumer.originalPositionFor({
line: startLine + 1,
column,
bias: SourceMapConsumer.LEAST_UPPER_BOUND,
Copy link
Member Author

Choose a reason for hiding this comment

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

When processing bundler wrapper, we dont get valid source position with "GREATEST_LOWER_BOUND"
So we use "LEAST_UPPER_BOUND", which is looking for "next mapping" instead of "previous mapping"
generatedPosition.line <= endLine + 1 check insures we did not jump to another function


if (previousPosition.source) {
if (dependantSourceFiles.has(previousPosition.source)) {
break;
Copy link
Member Author

Choose a reason for hiding this comment

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

Breaks our of const range of functionCall.ranges loop, as "function" is already processed

@shadowusr
Copy link
Member

@codex review

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: c26b09c07a

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@KuznetsovRoman KuznetsovRoman force-pushed the TESTPLANE-936.file_coverage branch from c26b09c to ffd851c Compare March 13, 2026 12:57
@KuznetsovRoman KuznetsovRoman force-pushed the TESTPLANE-936.file_coverage branch from ffd851c to 60def12 Compare March 18, 2026 14:21
@KuznetsovRoman KuznetsovRoman merged commit ec048f6 into master Mar 18, 2026
5 of 7 checks passed
@KuznetsovRoman KuznetsovRoman deleted the TESTPLANE-936.file_coverage branch March 18, 2026 14:24
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.

2 participants