refactor: Correct under-reported code coverage for Options/parsers - #10559
Conversation
|
🚀 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
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. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthrough
ChangesConfig parser loading
Estimated code review effort: 1 (Trivial) | ~5 minutes Suggested reviewers: Important Pre-merge checks failedPlease resolve all errors before merging. Addressing warnings is optional. ❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## alpha #10559 +/- ##
==========================================
+ Coverage 93.55% 93.78% +0.23%
==========================================
Files 192 192
Lines 16832 16832
Branches 248 248
==========================================
+ Hits 15747 15786 +39
+ Misses 1064 1025 -39
Partials 21 21 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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%.
d114402 to
720da56
Compare
|
@dblythy Please let CR review first before requesting a human review, thanks. |
|
@coderabbitai review |
✅ Action performedReview finished.
|
|
🎉 This change has been released in version 9.10.1-alpha.4 |
Issue
src/Options/parsers.jsreports ~2.5% coverage on Codecov even thoughspec/parsers.spec.jsfully covers it.Approach
Turns out it's a coverage measurement artifact, not missing tests.
resources/buildConfigDefinitions.jsimportedparsersfrom../src/Options/parsersat module scope. When the spec loads that tooling, nyc instruments the realsrc/file a second time (only the top level runs, the parser functions are never called on that path), and that collides with the sourcemap-remappedlib/coverage coming fromparsers.spec.js, clobbering it down to ~2.5%.mapperFor(the only thing the spec imports) doesn't useparsersanyway - onlyparseDefaultValuedoes. Moving the require in there drops the module-scopesrcinstrumentation, so the file reports its true 100% and the generator still works.Verified by loading
parsers.spec.js+buildConfigDefinitions.spec.jstogether: 40/40 lines with the change, 1/40 without.Tasks
spec/parsers.spec.js)Summary by CodeRabbit