Skip to content

Add golden CLI help integration test#394

Open
cduggn wants to merge 1 commit into
add-integration-testingfrom
codex/add-golden-file-integration-test
Open

Add golden CLI help integration test#394
cduggn wants to merge 1 commit into
add-integration-testingfrom
codex/add-golden-file-integration-test

Conversation

@cduggn

@cduggn cduggn commented Jan 7, 2026

Copy link
Copy Markdown
Owner

Motivation

  • Provide a stable, easy-to-update integration test for the CLI by snapshotting the root help output to a golden file.
  • Protect against accidental formatting or output regressions in the help/usage text including ASCII header art.
  • Make it simple to refresh the expected output when intentional changes are made by using an update flag.

Description

  • Add cmd/ccexplorer/integration_test.go containing TestCLIHelpGolden which runs cli.RootCommand() and captures its combined stdout/stderr.
  • The test compares the command output to the golden fixture at cmd/ccexplorer/testdata/help.golden and supports regenerating it with the -update flag.
  • Add the initial golden fixture at cmd/ccexplorer/testdata/help.golden containing the expected CLI help output.

Testing

  • Ran go test ./cmd/ccexplorer -run TestCLIHelpGolden -update to generate the golden file, which completed successfully.
  • Ran go test ./cmd/ccexplorer -run TestCLIHelpGolden to validate the test against the committed golden file, which passed.

Codex Task

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.

1 participant