Category
Missing tests
Description
cmd/virtwork has only 11% test coverage — the lowest of any package in the project. This package contains the Cobra command wiring, flag parsing, runE, cleanupE, printSummary, printCleanupPreview, PromptForConfirmation, and initAuditor. These are the primary user-facing code paths, and bugs here are the most likely to reach end users.
The orchestrator underneath has 73% coverage, but the Cobra command layer that calls into it is largely untested. Flag validation, --dry-run paths, error formatting, and interactive prompt handling all lack unit tests.
Severity
Medium — increases maintenance burden or risk of future bugs
Affected Files
cmd/virtwork/main.go — runE, cleanupE, printSummary, printCleanupPreview, initAuditor, PromptForConfirmation
Proposed Fix
Add Ginkgo BDD tests for:
- Flag validation and mutual exclusion (e.g.
--dry-run vs --yes)
--dry-run execution path (no K8s calls, expected output)
initAuditor with --no-audit and --audit-db flags
printSummary and printCleanupPreview output formatting
PromptForConfirmation with simulated stdin
- Error propagation from
runE/cleanupE to the root command
Area
CLI / Configuration, Testing
Architecture Layer
Layer 4 - Orchestration (cmd, cleanup)
Category
Missing tests
Description
cmd/virtworkhas only 11% test coverage — the lowest of any package in the project. This package contains the Cobra command wiring, flag parsing,runE,cleanupE,printSummary,printCleanupPreview,PromptForConfirmation, andinitAuditor. These are the primary user-facing code paths, and bugs here are the most likely to reach end users.The orchestrator underneath has 73% coverage, but the Cobra command layer that calls into it is largely untested. Flag validation,
--dry-runpaths, error formatting, and interactive prompt handling all lack unit tests.Severity
Medium — increases maintenance burden or risk of future bugs
Affected Files
cmd/virtwork/main.go—runE,cleanupE,printSummary,printCleanupPreview,initAuditor,PromptForConfirmationProposed Fix
Add Ginkgo BDD tests for:
--dry-runvs--yes)--dry-runexecution path (no K8s calls, expected output)initAuditorwith--no-auditand--audit-dbflagsprintSummaryandprintCleanupPreviewoutput formattingPromptForConfirmationwith simulated stdinrunE/cleanupEto the root commandArea
CLI / Configuration, Testing
Architecture Layer
Layer 4 - Orchestration (cmd, cleanup)