Skip to content

[quality] Cover pure-logic branches: is_valid_repo_name, malformed cron, empty-input formatting helpers - #52

Merged
Danathar merged 1 commit into
mainfrom
quality/test-pure-logic-branches
Aug 26, 2026
Merged

[quality] Cover pure-logic branches: is_valid_repo_name, malformed cron, empty-input formatting helpers#52
Danathar merged 1 commit into
mainfrom
quality/test-pure-logic-branches

Conversation

@danathar-atomic-hive

Copy link
Copy Markdown
Contributor

Test Improvement

Adds unit tests for 9 statements in atomic_image_builder.py that were
covered by neither the unit suite nor the container end-to-end suite,
verified by combining unit + e2e coverage data from CI run
33004520817
(commit 3987b67dd47e7f93b6bc2434c2c406a5f1400c08) per .coveragerc.e2e's
merge path. Lines closed: 328, 332, 384, 387, 391, 1321, 3734, 3739-3741, 3746.

New tests added to tests/test_atomic_image_builder.py:

  • test_is_valid_repo_name_* (4 tests) — is_valid_repo_name had zero prior
    tests: empty/overlong input, .git suffix, disallowed characters, valid slug
  • test_format_daily_rebuild_note_falls_back_for_* (3 tests) — the malformed-cron
    fallback branches (wrong field count, non-daily schedule, out-of-range time)
    were untested; only the well-formed daily-cron path had coverage
  • test_repository_status_omits_description_separator_when_unset — the
    empty-image_desc branch
  • test_pager_text_with_hint_handles_empty_body — the empty-body branch
  • test_read_only_pager_text_* (2 tests) — had zero prior tests
  • test_format_key_value_rows_* (2 tests) — had zero prior tests

All are pure-logic functions/methods with no subprocess or gum dependency,
so no new mocking infrastructure was needed. Full suite passes (609 tests),
ruff check passes, and coverage report --fail-under=90 still passes
(97% on atomic_image_builder.py).

Related Issue

Refs #51 — that issue tracks the remaining 68 uncovered lines, which need
subprocess/gum mocking and are out of scope for this PR.


Filed by quality agent (hold-gated mode). Human review required.

— hive: agent=quality backend=claude model=claude-sonnet-5 claude=2.1.226

Adds unit tests for branches exercised by neither the unit suite nor
the container end-to-end suite (verified by combining unit + e2e
coverage data from CI run 33004520817, commit 3987b67, per
.coveragerc.e2e):

- is_valid_repo_name: no prior test coverage at all (empty/overlong,
  .git suffix, disallowed characters, valid slug)
- format_daily_rebuild_note: malformed-cron fallback branches
  (wrong field count, non-daily schedule, out-of-range time)
- repository_status: empty image_desc branch
- pager_text_with_hint: empty-body branch
- read_only_pager_text: no prior test coverage at all
- format_key_value_rows: no prior test coverage at all

Signed-off-by: danathar-atomic-hive[bot] <320561496+danathar-atomic-hive[bot]@users.noreply.github.com>
@Danathar
Danathar merged commit 75a898b into main Aug 26, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant