fix: enforce branch coverage alongside the 100% line floor (#49) - #58
Merged
Merged
Conversation
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.
Closes #49
Acceptance criterion (verbatim): "CI's Tests step enforces 100% line and branch coverage on
jq_collector."What changed
collector/pyproject.toml:branch = truein[tool.coverage.run]. CI's Tests step runspytest --cov=jq_collectorand pytest-cov readsfail_under = 100from[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.
__main__.pyif not cfg.token:falsetest_main_does_not_warn_when_a_token_is_set(test_main.py)github.pyactive_workflows,if path:falsetest_a_shared_name_with_no_path_to_fall_back_on_keeps_its_name(test_workflows.py)github.pycoverage_artifact,if created >= best_at:falsetest_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 armtest_an_older_run_later_in_the_feed_does_not_replace_a_newer_one(test_workflows.py), the mirror oftest_latest_is_by_completion_not_feed_orderNo package source changed.
Gates (from
collector/, asci.ymlruns 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: cleanuv run --frozen mypy(strict): no issuesprek run(the new pre-commit config) over the staged files: all applicable hooks passNot addressed:
GitHub.coverage_percent's docstring saysbranch-rateisn'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