Reach full branch coverage#372
Conversation
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Walkthrough
ChangesJsonSchema getIterator 修正とエッジケーステスト追加
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ 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 @@
## 1.x #372 +/- ##
===========================================
Coverage 100.00% 100.00%
Complexity 687 687
===========================================
Files 96 96
Lines 1720 1722 +2
===========================================
+ Hits 1720 1722 +2 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
@coderabbitai review |
✅ Action performedReview finished.
|
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@tests/JsonSchema/Interceptor/JsonSchemaInterceptorTest.php`:
- Around line 143-149: The test method uses a hardcoded file path to write
schema test data, which causes race conditions and cleanup issues when tests run
in parallel. Replace the fixed path for the schema file with a temporary file
created using PHP's temporary file functions, and ensure the temporary file is
properly deleted after the test completes using a finally block or similar
cleanup mechanism. This will prevent test pollution and race conditions during
parallel test execution.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: b6d7fb90-5a97-46e4-bb4a-fabd9955fe64
📒 Files selected for processing (6)
src/JsonSchema/JsonSchemaErrors.phptests/JsonSchema/Interceptor/JsonSchemaInterceptorTest.phptests/JsonSchema/JsonSchemaErrorMapperTest.phptests/JsonSchema/JsonSchemaErrorTest.phptests/JsonSchema/JsonSchemaErrorsTest.phptests/JsonSchema/SchemaErrorMessageResolverTest.php
Fix CodeRabbit review: replace hardcoded path with tempnam + finally cleanup to prevent parallel test collisions and leftover files.
|
@coderabbitai 確認ありがとうございました。ご指摘の通り、固定パスではなく |
|
@coderabbitai Thanks for the review. As suggested, I replaced the hardcoded path with |
|
Tip For best results, initiate chat on the files or code changes.
(๑˃̵ᴗ˂̵)و |
|
Tip For best results, initiate chat on the files or code changes.
|
What changed
JsonSchemaErrors::getIterator()so branch/path instrumentation records the generator path fully.Why
The suite already had full line coverage, but branch coverage was slightly below 100%. These changes make the branch coverage target explicit and verifiable.
Validation
upstream/1.xbefore creating this PR.composer coverage.OK (409 tests, 709 assertions).Branches: 100.00% (1150/1150),Lines: 100.00% (1453/1453),Methods: 100.00% (319/319),Classes: 100.00% (96/96).