Skip to content

[quality] test uncovered Gum/App guard-clause branches - #54

Merged
Danathar merged 1 commit into
mainfrom
quality/test-gum-guard-clauses
Aug 27, 2026
Merged

[quality] test uncovered Gum/App guard-clause branches#54
Danathar merged 1 commit into
mainfrom
quality/test-gum-guard-clauses

Conversation

@danathar-atomic-hive

Copy link
Copy Markdown
Contributor

Test Improvement

Adds 7 unit tests in tests/test_atomic_image_builder.py closing 7 of the 68 lines in atomic_image_builder.py flagged in #51 as uncovered by both the unit and e2e suites:

  • App.clear() delegating to Gum.clear() (line 1247)
  • App.show_step_header()'s next_hint branch (line 1274)
  • App.show_managed_repo_warning()'s bluebuild-hint branch (line 1443)
  • App.create_new_image(scanned=True) carrying github_user into the fresh wizard config (line 1670)
  • App.select_repo()'s long-description truncation in the picker label (line 3241)
  • App.update_menu()'s dispatch to offer_brew_if_applicable() on the 'Homebrew' task (lines 3489-3490)

Verified with the repo's own coverage + unittest combo (python3 -m coverage run -m unittest discover -s tests): unit-test misses on atomic_image_builder.py drop from 69 to 62 lines, matching exactly the 7 lines above. All 616 tests pass (609 existing + 7 new), no regressions.

Follows the mocking patterns already established in the suite (GumStub, patch.object(app, ...)) — added a clear_calls counter to GumStub since it had no way to observe Gum.clear() calls before.

Does not close #51 — 61 of the originally-flagged 68 lines remain, concentrated in the Gum/App subprocess-heavy clusters (GitHub CLI wrappers, terminal-width/gum-arg plumbing, project-file rendering edge cases) that need more involved subprocess.run/gh mocking than this pass covers.

Related Issue

Refs #51 (partial — chips away at the remaining unit-coverage gap; does not fully resolve it)


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 7 of the 68 lines flagged uncovered by both unit
and e2e suites in atomic_image_builder.py (issue #51, commit 3987b67):

- App.clear() delegating to Gum.clear() (line 1247)
- App.show_step_header()'s next_hint branch (line 1274)
- App.show_managed_repo_warning()'s bluebuild-hint branch (line 1443)
- App.create_new_image(scanned=True) carrying github_user into the
  fresh wizard config (line 1670)
- App.select_repo()'s long-description truncation in the picker
  label (line 3241)
- App.update_menu()'s dispatch to offer_brew_if_applicable() on the
  'Homebrew' task (lines 3489-3490)

Ran the repo's own unittest+coverage combo before and after
(python3 -m coverage run -m unittest discover -s tests): unit misses
on atomic_image_builder.py drop from 69 to 62 lines, all 7 closed
lines matching those listed above. 616 tests pass, no regressions.

Signed-off-by: quality (hive-wild-mole) <hive-quality@users.noreply.github.com>
@Danathar
Danathar merged commit 230b068 into main Aug 27, 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.

[quality] Coverage gap: 43 remaining branches uncovered by unit and e2e tests

1 participant