Skip to content

[quality] test: add unit tests for cobra command structure and help output#73

Open
hanthor-hive-agent[bot] wants to merge 2 commits into
mainfrom
quality/test-cmd-structure
Open

[quality] test: add unit tests for cobra command structure and help output#73
hanthor-hive-agent[bot] wants to merge 2 commits into
mainfrom
quality/test-cmd-structure

Conversation

@hanthor-hive-agent

Copy link
Copy Markdown

Test Improvement\n\nAdd structural unit tests for the CLI command tree in cmd/ (the last untested Go package in bluefin-cli). All tests use cmd.Find() or cmd.Help() directly instead of rootCmd.Execute() to avoid triggering the countme goroutine or interactive TUI code.\n\n### Tests added (10 test functions, 50+ assertions)\n\n- Command tree: Verifies all 15 subcommands (cleanup, countme, docs, fonts, help, init, install, install-wallpapers, install-wallpapers-cleanup, menu, motd, shell, starship, status, sunset, uninstall) are registered under root\n- Nested subcommands: motd (config/show/toggle), shell (config), starship (install/theme), sunset (setup)\n- Root command: Version set, PersistentPreRunE exists (countme ping), RunE exists (default menu)\n- Help output: Root and all 12 subcommands produce valid help with Usage section\n- Required flags: install (--non-interactive, --yes), countme (--disable, --enable, --status), shell config (--shell)\n- Version template: Template contains "version" string\n- Command tree size: At least 15 total commands in the tree\n\nFixes #66\n\n---\nFiled by quality agent (ACMM L4/L6 — full mode)

…utput

Add structural tests for the CLI command tree that verify:

- All 15 subcommands are registered (cleanup, countme, docs, fonts,
  help, init, install, install-wallpapers, install-wallpapers-cleanup,
  menu, motd, shell, starship, status, sunset, uninstall)
- Nested subcommands (motd: config/show/toggle, shell: config,
  starship: install/theme, sunset: setup)
- Required flags on key commands (install: --non-interactive/--yes,
  countme: --disable/--enable/--status)
- Help output format for root and all subcommands
- Version template presence
- PersistentPreRunE and default RunE exist on root command
- Command tree size (minimum 15 commands)

All tests use cmd.Find() or cmd.Help() directly instead of
rootCmd.Execute() to avoid triggering PersistentPreRunE (countme
goroutine) and interactive TUI code.

Fixes #66

Signed-off-by: Quality Agent <quality@hive.local>
Signed-off-by: hive-outreach-agent <outreach@hive.tunaos>
@hanthor-hive-agent hanthor-hive-agent Bot added the enhancement New feature or request label Jun 28, 2026
Signed-off-by: hive-outreach-agent <outreach@hive.tunaos>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants