fix: stop composer test from masking failures and skipping tests#92
Conversation
The test script appended '|| exit 0', so 'composer test' (and the 'check' aggregate) reported success even when tests failed. Worse, the <coverage> report block in phpunit.xml made PHPUnit 12 abort without running any tests when no coverage driver (pcov/xdebug) is loaded — locally that meant 'No tests executed!' while the script still exited 0. CI is unaffected: it loads pcov and passes coverage options on the command line, so the XML report block was unused. Remove both. 'composer test' now runs the suite everywhere and propagates failures; coverage reports remain available via the CLI flags CI already uses. Claude-Session: https://claude.ai/code/session_017XTM7pxbWPVNLV639i5WgK
|
Warning Review limit reached
Next review available in: 58 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the 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 configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (2)
✨ 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 @@
## main #92 +/- ##
===========================================
Coverage 100.00% 100.00%
Complexity 40 40
===========================================
Files 2 2
Lines 80 80
===========================================
Hits 80 80
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. |
There was a problem hiding this comment.
Code Review
This pull request simplifies the test script in composer.json to run phpunit directly, ensuring that test failures and warnings are properly reported instead of being suppressed. It also removes the code coverage configuration from phpunit.xml. I have no further feedback to provide.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
There was a problem hiding this comment.
Pull request overview
This PR fixes the local/CI developer workflow by ensuring composer test and composer check correctly fail when the test suite fails, and by preventing PHPUnit from skipping all tests on environments without a coverage driver due to XML coverage configuration.
Changes:
- Update
composer.jsonsocomposer testruns PHPUnit directly (no longer masks failures). - Remove
<coverage>reporting configuration fromphpunit.xmlto avoid “No code coverage driver available / No tests executed!” behavior when no coverage driver is installed.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| phpunit.xml | Removes built-in coverage report configuration so PHPUnit still executes tests when no coverage driver is available. |
| composer.json | Makes composer test run phpunit without masking failures, so composer check properly reflects test outcomes. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
概要
コードレビューで指摘した「
composer testがテスト失敗を握りつぶす」問題の修正です。調査の結果、実際はさらに悪い状態でした。問題
"test": "phpunit --do-not-fail-on-warning || exit 0"の|| exit 0により、テストが失敗してもcomposer test(およびcomposer check)は成功扱いになる<coverage>レポート設定により、カバレッジドライバ(pcov/xdebug)が無い環境では PHPUnit 12 がテストを 1 件も実行せず終了することを確認しました:つまりドライバ無しのローカル環境では「テスト 0 件実行 + exit 0」で、
composer checkが何も検証していませんでした。修正
|| exit 0と--do-not-fail-on-warningを削除(警告での失敗は phpunit.xml のfailOnWarning="false"で既に制御されており冗長)<coverage>レポートブロックを削除。CI は pcov をロードした上で--coverage-clover等を CLI フラグで渡しているため、この XML 設定は CI では未使用でした検証(PHP 8.4.7、カバレッジドライバなし)
phpunit: 69 tests / 111 assertions パス、exit 0composer validate --strict: パスhttps://claude.ai/code/session_017XTM7pxbWPVNLV639i5WgK