[quality] Cover pure-logic branches: is_valid_repo_name, malformed cron, empty-input formatting helpers - #52
Merged
Conversation
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>
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.
Test Improvement
Adds unit tests for 9 statements in
atomic_image_builder.pythat werecovered 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'smerge 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_namehad zero priortests: empty/overlong input,
.gitsuffix, disallowed characters, valid slugtest_format_daily_rebuild_note_falls_back_for_*(3 tests) — the malformed-cronfallback 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— theempty-
image_descbranchtest_pager_text_with_hint_handles_empty_body— the empty-body branchtest_read_only_pager_text_*(2 tests) — had zero prior teststest_format_key_value_rows_*(2 tests) — had zero prior testsAll are pure-logic functions/methods with no subprocess or
gumdependency,so no new mocking infrastructure was needed. Full suite passes (609 tests),
ruff checkpasses, andcoverage report --fail-under=90still passes(97% on
atomic_image_builder.py).Related Issue
Refs #51 — that issue tracks the remaining 68 uncovered lines, which need
subprocess/gummocking 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