Skip to content

fix: enforce branch coverage alongside the 100% line floor (#49) - #58

Merged
tschm merged 1 commit into
mainfrom
rhiza_fix_49_20260925
Sep 25, 2026
Merged

tschm merged 1 commit into
mainfrom
rhiza_fix_49_20260925

Conversation

@tschm

@tschm tschm commented Sep 25, 2026

Copy link
Copy Markdown
Member

Closes #49

Acceptance criterion (verbatim): "CI's Tests step enforces 100% line and branch coverage on jq_collector."

What changed

  • collector/pyproject.toml: branch = true in [tool.coverage.run]. CI's Tests step runs pytest --cov=jq_collector and pytest-cov reads fail_under = 100 from [tool.coverage.report], so the same floor now covers branches with no workflow change.

  • Turning it on left 4 partial branches, all in code that was already line-covered. I closed each with a test next to the one it mirrors. The maintainer asked for these tests to be written; they were flagged in triage as a design choice.

    Arm never taken Test added
    __main__.py if not cfg.token: false test_main_does_not_warn_when_a_token_is_set (test_main.py)
    github.py active_workflows, if path: false test_a_shared_name_with_no_path_to_fall_back_on_keeps_its_name (test_workflows.py)
    github.py coverage_artifact, if created >= best_at: false test_an_older_artifact_listed_after_a_newer_one_does_not_win (test_coverage.py)
    github.py _newest_per_workflow, the older-run-doesn't-replace arm test_an_older_run_later_in_the_feed_does_not_replace_a_newer_one (test_workflows.py), the mirror of test_latest_is_by_completion_not_feed_order
  • No package source changed.

Gates (from collector/, as ci.yml runs them)

  • pytest --cov=jq_collector: 455 passed; 1367 statements and 402 branches, 0 missed, 0 partial: 100%. The same on --python 3.11.
  • ruff check / ruff format --check jq_collector tests: clean
  • uv run --frozen mypy (strict): no issues
  • prek run (the new pre-commit config) over the staged files: all applicable hooks pass

Not addressed: GitHub.coverage_percent's docstring says branch-rate isn't read because branch coverage "is not enabled in this fleet's CI". That's still true of the fleet generally, but this repo's own artifact will now carry a real branch-rate. Whether the board should show it is a separate decision.

Merge note: #57 also edits tests/test_coverage.py, in a different test (the malformed-report parametrization), so the two hunks are far apart and should merge cleanly.

🤖 Generated with Claude Code

@tschm
tschm merged commit a92a5b9 into main Sep 25, 2026
5 checks passed
@tschm
tschm deleted the rhiza_fix_49_20260925 branch September 25, 2026 13:27
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.

Enforce branch coverage alongside the 100% line floor

1 participant