Skip to content

test: add automated CLI test suite#260

Merged
jacobbednarz merged 19 commits intomasterfrom
fresh-cli-testing
Mar 9, 2026
Merged

test: add automated CLI test suite#260
jacobbednarz merged 19 commits intomasterfrom
fresh-cli-testing

Conversation

@jacobbednarz
Copy link
Copy Markdown
Owner

@jacobbednarz jacobbednarz commented Mar 9, 2026

Summary

  • Add unit tests for determineAuthType and environ type
  • Add integration test infrastructure: TestMain builds the binary once, helpers isolate each test with temp XDG dirs and a file-backend keyring (no OS keyring required)
  • Add integration tests covering version, list (empty, api_key, api_token, multiple profiles), exec (error paths + happy path credential injection for both auth types), and add (arg validation)
  • Fix main.go to propagate cmd.Execute() error so cobra arg errors correctly return non-zero exit codes
  • Add CF_VAULT_BACKEND env var to openKeyring() for explicit backend selection in CI/tests

Test Plan

  • go test -v -race ./... — all 23 tests pass
  • gofmt -d ./cmd/ — no output
  • go vet ./... — no output

@jacobbednarz jacobbednarz merged commit 7fa8b4c into master Mar 9, 2026
1 check passed
@jacobbednarz jacobbednarz deleted the fresh-cli-testing branch March 9, 2026 04:23
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