Skip to content

tests: gate semvertag at 100% statement + branch coverage#1

Merged
lesnik512 merged 2 commits into
mainfrom
coverage/100-percent-gate
Jun 2, 2026
Merged

tests: gate semvertag at 100% statement + branch coverage#1
lesnik512 merged 2 commits into
mainfrom
coverage/100-percent-gate

Conversation

@lesnik512

Copy link
Copy Markdown
Member

Summary

  • Bring semvertag/ and the shared CI descriptor gate to 100% statement + branch coverage and lock the level in via fail_under = 100 so it can't regress.
  • Delete three unreachable defensive branches (dead ValueError in _use_case, the for-loop natural-exit in _transport, and the redundant OSError(EPIPE) handler in __main__ — Python 3.3+ already routes EPIPE to BrokenPipeError).
  • Promote pyyaml to a real dev dep so the descriptor-gate tests stop silently importorskip-ing in CI, and add the missing tests for the gate's main() entrypoint.

Test plan

  • just lint-ci — clean (ruff, ty, eof-fixer)
  • just test — 363 passed, coverage 100% / 100% branch, fail_under = 100 satisfied
  • just test --cov-report xml (CI's invocation) — clean, XML written
  • uv run python -m tests._descriptor_gate templates/semvertag.yml — exits 0
  • mkdocs build --strict — clean

🤖 Generated with Claude Code

lesnik512 and others added 2 commits June 3, 2026 00:16
Cover every reachable path in the semvertag package and the
shared CI descriptor gate, then lock the level in with
fail_under = 100 so it can't regress.

- _use_case: dict-dispatch in _compute_new_version drops the
  dead ValueError on the Bump.NONE-already-filtered branch
- _transport: while-True + explicit counter eliminates the
  unreachable "for loop completed naturally" exit branch
- __main__: drop the OSError(EPIPE) handler — Python 3.3+
  auto-dispatches EPIPE to BrokenPipeError, so the OSError
  arm is unreachable
- new tests/integration/test_cli_errors.py covers --version
  (incl. PackageNotFoundError fallback), every CLI override
  flag, the ValidationError / ValueError→ConfigError paths,
  ImportError / BrokenPipeError / SemvertagError from the
  use case, resilient-parsing early return, and the main()
  entry point
- gitlab provider tests cover unknown HTTP status, Link
  headers with empty URI / non-next rel / missing rel
- apply_cli_overlay nesting-depth>2 covered in unit tests
- pyyaml moved into dev deps; the importorskip workaround
  and `ty: ignore` go away; main() of the descriptor gate
  gets two new tests
- pyproject narrows --cov to semvertag + the two descriptor
  gate modules, makes --cov-branch the default, and sets
  fail_under = 100; redundant `just test-branch` removed

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…erage scope

Address review findings on the 100% coverage gate PR:

- test_cli_errors: replace MagicMock.assert_not_called() on a never-touched
  attribute with a monkeypatch that fails the test if `Settings` is constructed,
  giving the resilient_parsing branch a real assertion instead of a vacuous one.
- test_cli_errors: type `_RaisingUseCase.__call__` as `typing.NoReturn`
  (it always raises) and drop the now-unused `RunResult` import.
- pyproject: remove `--cov=tests.test_ci_descriptor_gate` from addopts — the
  file is plain test code with no pragmas/skips, so measuring its coverage
  produces no signal. `--cov=tests._descriptor_gate` (the script) stays.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@lesnik512 lesnik512 self-assigned this Jun 2, 2026
@lesnik512 lesnik512 merged commit 3a9736c into main Jun 2, 2026
6 checks passed
@lesnik512 lesnik512 deleted the coverage/100-percent-gate branch June 2, 2026 21:45
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.

1 participant