Skip to content

test: enforce 100% coverage - #163

Merged
uniqueg merged 2 commits into
devfrom
test/enforce-coverage
Oct 21, 2026
Merged

uniqueg merged 2 commits into
devfrom
test/enforce-coverage

Conversation

@uniqueg

@uniqueg uniqueg commented Oct 21, 2026 •

Copy link
Copy Markdown
Member

Summary

This PR combines two small issues, per the user's rule for tiny issues.

  • test: enforce 100% coverage #150, enforce 100% coverage:
    • fail_under = 100 in [tool.coverage.report], so coverage report and coverage xml (which CI runs) fail below 100%.
    • New codecov.yml with project and patch targets of 100%.
    • The contributing guide describes the enforcement.
  • chore: remove the PR template #151, remove the PR template: PULL_REQUEST_TEMPLATE.md is deleted, since templates will come from an organization-wide .github repository. The contributing guide no longer links it; it says what a pull request should describe. It doesn't link elixir-cloud-aai/.github, because that repository doesn't exist yet. Nothing else referred to the template, and the repo has no issue templates.

Closes #150
Closes #151

Light lane: the PR changes configuration and docs and removes a file, so the reviewer subagents are skipped (I reviewed the diff myself), per the user's rule.

Verification

  • coverage run -m pytest -p no:warnings (with Helm): 877 passed; coverage report and coverage xml exit 0 at 100%
  • Partial run (tests/test_utils.py only, 24%): coverage report and coverage xml exit 2 ("total of 24 is less than fail-under=100")
  • codecov.yml parses as YAML; ruff check . and mkdocs build --strict pass
  • git grep -i pull_request_template: no matches
  • CI: all checks pass, including codecov patch/project with the new 100% targets

Declined review findings

  • Sourcery: totals just below 100% could round up to the threshold. Declined: coverage.py special-cases fail_under = 100 (should_fail_under(): "it must really be 100"), so no rounding applies.

Open questions

None.

🤖 Generated with Claude Code

uniqueg and others added 2 commits October 22, 2026 00:35
Set fail_under = 100, so that coverage report and coverage xml (CI) fail
below 100%, and add a codecov.yml with project and patch targets of
100%. Describe the enforcement in the contributing guide.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Templates will come from an organization-wide .github repository, which
repository templates would override. The contributing guide now says
what a pull request describes instead of linking the template.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@sourcery-ai

sourcery-ai Bot commented Oct 21, 2026 •

Copy link
Copy Markdown

Reviewer's Guide

This PR makes 100% coverage an enforced quality gate by configuring coverage.py and Codecov, documents the requirement, and removes the repository-local pull request template in favor of concise general guidance for describing changes and verification.

File-Level Changes

Change Details Files
Enforce complete test coverage locally and in CI/Codecov.
  • Set coverage reporting to fail below 100%.
  • Require 100% project and pull-request patch coverage in Codecov.
  • Document the coverage enforcement and testing expectations.
pyproject.toml
codecov.yml
docs/contributing.md
Remove the repository-specific pull request template and replace its documentation with general submission guidance.
  • Delete the pull request template.
  • Tell contributors to describe what changed, why, and how it was tested.
  • Remove the template link from the contributing guide.
PULL_REQUEST_TEMPLATE.md
docs/contributing.md

Assessment against linked issues

Issue Objective Addressed Explanation
#150 Set coverage enforcement to 100% so local coverage reports and CI fail when coverage falls below the threshold. ✅
#150 Configure Codecov project and patch coverage targets to 100%. ✅
#150 Document the 100% coverage enforcement in the contributing or development documentation. ✅
#151 Remove repository-level issue and pull request templates and references to them. ✅

Possibly linked issues


Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@codecov

codecov Bot commented Oct 21, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (185389b) to head (f0317e3).

Additional details and impacted files
@@            Coverage Diff            @@
##               dev      #163   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           11        11           
  Lines          880       880           
=========================================
  Hits           880       880           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@uniqueg
uniqueg marked this pull request as ready for review October 21, 2026 22:41
@uniqueg

uniqueg commented Oct 21, 2026

Copy link
Copy Markdown
Member Author

@sourcery-ai review

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - I've found 1 issue

Prompt for AI Agents
Please address the comments from this code review:

## Individual Comments

### Comment 1
<location path="pyproject.toml" line_range="79" />
<code_context>
 exclude_also = ['if __name__ == "__main__":']
+# `coverage report` and `coverage xml` (CI) fail below 100%; Codecov's
+# targets are the same (`codecov.yml`)
+fail_under = 100

 [project]
</code_context>
<issue_to_address>
**Uncovered code passes coverage gate**

When actual coverage is below 100% but rounds to 100% at the default zero-decimal precision, `coverage report` and `coverage xml` compare the rounded total with `fail_under`, so CI succeeds despite uncovered statements.

Configure coverage.py to use sufficient report precision so sub-100% coverage does not round up to the threshold.
</issue_to_address>

Sourcery assessment

Approval pending. 1 finding to address first.

Blocking findings: pyproject.toml:79


Sourcery is free for open source - if you like our reviews please consider sharing them ✨

Comment thread pyproject.toml Resolved
@uniqueg
uniqueg merged commit aec4061 into dev Oct 21, 2026
12 checks passed
@uniqueg
uniqueg deleted the test/enforce-coverage branch October 21, 2026 23:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

chore: remove the PR template test: enforce 100% coverage

1 participant