Skip to content

refactor: Correct under-reported code coverage for Options/parsers#10559

Open
dblythy wants to merge 1 commit into
parse-community:alphafrom
dblythy:fix/coverage-parsers-dual-instrumentation
Open

refactor: Correct under-reported code coverage for Options/parsers#10559
dblythy wants to merge 1 commit into
parse-community:alphafrom
dblythy:fix/coverage-parsers-dual-instrumentation

Conversation

@dblythy

@dblythy dblythy commented Jul 5, 2026

Copy link
Copy Markdown
Member

Issue

src/Options/parsers.js reports ~2.5% coverage on Codecov even though spec/parsers.spec.js fully covers it.

Approach

Turns out it's a coverage measurement artifact, not missing tests. resources/buildConfigDefinitions.js imported parsers from ../src/Options/parsers at module scope. When the spec loads that tooling, nyc instruments the real src/ file a second time (only the top level runs, the parser functions are never called on that path), and that collides with the sourcemap-remapped lib/ coverage coming from parsers.spec.js, clobbering it down to ~2.5%.

mapperFor (the only thing the spec imports) doesn't use parsers anyway - only parseDefaultValue does. Moving the require in there drops the module-scope src instrumentation, so the file reports its true 100% and the generator still works.

Verified by loading parsers.spec.js + buildConfigDefinitions.spec.js together: 40/40 lines with the change, 1/40 without.

Tasks

  • Tests already exist (spec/parsers.spec.js)

@parse-github-assistant

Copy link
Copy Markdown

🚀 Thanks for opening this pull request! We appreciate your effort in improving the project. Please let us know once your pull request is ready for review.

Tip

  • Keep pull requests small. Large PRs will be rejected. Break complex features into smaller, incremental PRs.
  • Use Test Driven Development. Write failing tests before implementing functionality. Ensure tests pass.
  • Group code into logical blocks. Add a short comment before each block to explain its purpose.
  • We offer conceptual guidance. Coding is up to you. PRs must be merge-ready for human review.
  • Our review focuses on concept, not quality. PRs with code issues will be rejected. Use an AI agent.
  • Human review time is precious. Avoid review ping-pong. Inspect and test your AI-generated code.

Note

Please respond to review comments from AI agents just like you would to comments from a human reviewer. Let the reviewer resolve their own comments, unless they have reviewed and accepted your commit, or agreed with your explanation for why the feedback was incorrect.

Caution

Pull requests must be written using an AI agent with human supervision. Pull requests written entirely by a human will likely be rejected, because of lower code quality, higher review effort and the higher risk of introducing bugs. Please note that AI review comments on this pull request alone do not satisfy this requirement. Our CI and AI review are safeguards, not development tools. If many issues are flagged, rethink your development approach. Invest more effort in planning and design rather than using review cycles to fix low-quality code.

@coderabbitai

coderabbitai Bot commented Jul 5, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You’ve reached a temporary PR review limit under our Fair Usage Limits Policy.

Your recent review volume is higher than typical usage, so adaptive limits are currently applied.

Next review available in: 3 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: d61c7da4-a84f-47e0-951e-b0217477ef43

📥 Commits

Reviewing files that changed from the base of the PR and between 7e9d53a and 720da56.

📒 Files selected for processing (1)
  • resources/buildConfigDefinitions.js
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands.

@codecov

codecov Bot commented Jul 5, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.89%. Comparing base (cce91e5) to head (720da56).
⚠️ Report is 1 commits behind head on alpha.

Additional details and impacted files
@@            Coverage Diff             @@
##            alpha   #10559      +/-   ##
==========================================
+ Coverage   92.66%   92.89%   +0.22%     
==========================================
  Files         193      193              
  Lines       16981    16980       -1     
  Branches      248      248              
==========================================
+ Hits        15736    15774      +38     
+ Misses       1224     1185      -39     
  Partials       21       21              

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

buildConfigDefinitions imported parsers from ../src/Options/parsers at
module scope. Loading it in a spec instruments the real src file a
second time (top level only), colliding with the sourcemap-remapped lib
coverage from parsers.spec.js and clobbering it down to ~2.5%. Move the
require into parseDefaultValue, its only consumer, so the module reports
its true 100%.
@dblythy dblythy force-pushed the fix/coverage-parsers-dual-instrumentation branch from d114402 to 720da56 Compare July 5, 2026 12:32
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.

1 participant