Increase AI server test coverage - #4
Draft
roncodes wants to merge 46 commits into
Draft
Conversation
Add a Codecov upload step to the backend CI using codecov-action@v5 with the organization CODECOV_TOKEN, and a coverage badge to the README. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Welcome to Codecov 🎉Once you merge this PR into your default branch, you're all set! Codecov will compare coverage reports and display results in all future pull requests. Thanks for integrating Codecov - We've got you covered ☂️ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This draft PR wires backend coverage reporting into the AI package CI and brings the backend-only
./servertest target to full coverage.It also fixes the class coverage reporting bug. Clover can omit aggregate
coveredclasses, which previously made the summary report0.00%class coverage even when file-level class metrics were present. The coverage summary now derives class coverage from file-level metrics when the aggregate value is missing.The backend tests have also been organized into explicit PHPUnit suites instead of living as a flat list under
server/tests.Current Coverage
Latest successful backend CI run:
30200831059Latest Clover check reports no uncovered backend statements.
Test Organization
phpunit.xml.distnow defines two backend suites:unit:server/tests/Unitfeature:server/tests/FeatureCurrent structure:
server/tests/Unit/Services: service/provider/query/task/attachment unit coverageserver/tests/Unit/Support: support registry, capability, temporal, and queryable-resource coverageserver/tests/Unit/Coverage: coverage-reporting regression coverageserver/tests/Feature/Http: controller, model, provider-flow, and HTTP-facing behavior coverageserver/tests/Support/helpers.php: shared test helpers loaded by the Pest bootstrapThis removes the old flat test layout and avoids hidden test file load-order coupling by centralizing shared helpers and resetting HTTP fakes for provider tests.
Coverage Added
Setting/Auth/DBfacade adapters, and the isolated Anthropic test-error HTTP boundary. Their calling behavior is covered through injectable/overridable helpers.Validation
composer lintphp -lon touched backend source/test filesgit diff --checkgit diff --cached --check3020083105930200831096Notes
Local
composer test:unitremains blocked in this shell because Pest dependencies are not installed locally (Unable to find Pest. Run composer install first.). CI installs dependencies and is the authoritative backend test/coverage signal for this PR.