Repository navigation
test: enforce 100% coverage - #377
Merged
Merged
Conversation
FOCA's coverage is at 100% (1390 tests). Set fail_under = 100 in [tool.coverage.report], so coverage report and coverage xml (CI) fail below it, and add a codecov.yml with project and patch targets of 100%, as in cloud-registry. Exclude TYPE_CHECKING blocks explicitly, since coverage only excludes them by default from 7.10 on and the dev extra allows 7.6. CI also prints the missing lines with coverage report -m. The README's contributing section describes the rule. Closes #345 Co-Authored-By: Claude Opus 5.5 <[email protected]>
Reviewer's GuideThis PR enforces FOCA’s existing 100% test-coverage level by centralizing coverage settings in Flow diagram for enforced 100% coverage checksflowchart LR
Tests[Run pytest with coverage] --> Report[coverage report -m]
Report --> Threshold{Coverage reaches 100%}
Threshold -->|Yes| XML[coverage xml]
Threshold -->|No| Fail[Fail CI and local command]
XML --> Codecov[Codecov project and patch checks]
Codecov -->|Target 100%| Pass[Coverage checks pass]
File-Level Changes
Possibly linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## dev #377 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 25 25
Lines 2133 2133
=========================================
Hits 2133 2133
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
uniqueg
marked this pull request as ready for review
October 22, 2026 01:48
1 task
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
FOCA's coverage is already at 100%, so this PR only enforces it, as cloud-registry does (elixir-cloud-aai/cloud-registry#163):
pyproject.toml:[tool.coverage.run] source = ["foca"]and[tool.coverage.report] fail_under = 100, socoverage reportandcoverage xmlfail below 100%.if TYPE_CHECKING:blocks are excluded explicitly (exclude_also): coverage excludes them by default only in recent versions (7.16 does, 7.6 doesn't), and thedevextra allowscoverage>=7.6; with 7.6 the total was 99% (3 lines).codecov.ymlwithprojectandpatchtargets of 100% (same file as cloud-registry's).checks.yml, unit test jobs):coverage run -m pytest(source from the config), thencoverage report -m(prints the missing lines, fails below 100%), thencoverage xml. All Python versions (3.11 to 3.14, MongoDB 7.0, plus 3.13 with MongoDB 8.0 where the kernel allows it) run this step, so each fails below 100%.Closes #345
Light lane: the PR changes only configuration, a CI step and docs (no code), so the reviewer subagents and the Sourcery wait are skipped, per the user's rule; I reviewed the diff myself.
Verification
coverage run -m pytest(Python 3.13, MongoDB 7.0 on port 12345): 1390 passed;coverage reportandcoverage xmlexit 0 at 100% (2120 statements, 0 missed)exclude_also(99% without it)tests/test_foca.pyonly, 52%):coverage reportandcoverage xmlexit 2 ("total of 52 is less than fail-under=100")ruff check,ruff format --check,mypy(71 files),mkdocs build --strictpass;codecov.ymlparses as YAMLpip install -e .[dev,docs], line 41)Open questions
None.
🤖 Generated with Claude Code
Summary by Sourcery
Enforce complete test coverage consistently across local checks, CI, and Codecov.
Enhancements:
CI:
Documentation: