Skip to content

Add package doc comment and root command tests#137

Closed
masnwilliams wants to merge 2 commits intomainfrom
hypeship/add-main-comment
Closed

Add package doc comment and root command tests#137
masnwilliams wants to merge 2 commits intomainfrom
hypeship/add-main-comment

Conversation

@masnwilliams
Copy link
Contributor

@masnwilliams masnwilliams commented Mar 21, 2026

Summary

  • Adds a Go package-level doc comment to cmd/kernel/main.go explaining what the CLI does.
  • Adds tests to cmd/root_test.go covering:
    • TestRootCommandSubcommands — verifies all expected subcommands are registered on the root command.
    • TestRootCommandHelpOutput — executes --help and checks the output contains key command names.
    • TestLogLevelToPterm — table-driven test for log level string parsing, including invalid input fallback.
    • TestIsUsageError — validates detection of cobra usage error patterns.

Test plan

  • Run go test ./cmd/... and confirm all new tests pass alongside existing TestIsAuthExempt.

@masnwilliams masnwilliams changed the title Add package-level doc comment to main.go Add package doc comment and root command tests Mar 21, 2026
@kernel-internal
Copy link
Contributor

🔧 CI Fix Available

I've pushed a fix for the CI failure (go vet error: non-constant format string in fmt.Errorf).

The fix replaces fmt.Errorf(tt.err) with errors.New(tt.err) in cmd/root_test.go.

👉 Click here to create a PR with the fix

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant