Repository navigation
test: cover the three branches the suite never took - #640
Conversation
Line coverage was already 100%, but three conditions only ever went one way. Add a test for each and measure branches from now on, so Codecov reports both.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Merge Risk: ⚪ Minimal · up to
|
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #640 +/- ##
==========================================
Coverage 100.00% 100.00%
==========================================
Files 14 14
Lines 2429 2429
Branches 0 470 +470
==========================================
Hits 2429 2429 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Merging this PR will not alter performance1 warning
Performance Changes
Comparing Footnotes
|



Requested by Xianpeng · project thread
Summary
Line coverage of
commit_check/was already 100%, but three conditions were only ever taken one way. This adds one test for each and turns on branch measurement, so Codecov keeps reporting both.coverage report, branch mode)The branches that were never taken, and the test that now takes them:
config.py_load_parent_config: a relativeinherit_fromthat exists neither next to the config, nor in the current directory, nor at the repository top. The new test checks it is reported and skipped, not read from somewhere else.engine.py_tags_on_pushed_commits: a pre-commit pre-push line that deletes a branch (all-zero local SHA). The new test checks that it contributes no commits, and only the branch pushed beside it is read.rule_builder.py_build_tag_rules: aTAG_RULESentry whose check is nottag. Only one entry exists today, so the test adds a second one and checks the[tag]regex is not applied to it.pyproject.tomlgetsbranch = trueunder[tool.coverage.run], sonox -s coverageand the uploadedcoverage.xmlcarry branch data. No exclusions orpragma: no coverwere added.Test plan
coverage run --source commit_check -m pytestthencoverage report: TOTAL 2429 stmts, 0 miss, 940 branches, 0 partial, 100%.ruff checkandruff format --checkpass ontests/.Summary by CodeRabbit