Skip to content

Make golden files for pretty printing cli errors #11588

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Emyrk opened this issue Jan 12, 2024 · 0 comments · Fixed by #12698
Closed

Make golden files for pretty printing cli errors #11588

Emyrk opened this issue Jan 12, 2024 · 0 comments · Fixed by #12698

Comments

@Emyrk
Copy link
Member

Emyrk commented Jan 12, 2024

We have a set of test cli cmds that show examples of our pretty printing for errors.

func (RootCmd) errorExample() *clibase.Cmd {

We should have a unit test that makes golden files to prevent accidental changes.

@cdr-bot cdr-bot bot added the feature label Jan 12, 2024
elasticspoon added a commit to elasticspoon/coder that referenced this issue Mar 21, 2024
Creates golden files from `coder/cli/errors.go`.
Adds a unit test to test against golden files.
Adds a make file command to regenerate golden files.
Abstracts test against golden files.
elasticspoon added a commit to elasticspoon/coder that referenced this issue Mar 29, 2024
Creates golden files from `coder/cli/errors.go`.
Adds a unit test to test against golden files.
Adds a make file command to regenerate golden files.
Abstracts test against golden files.

fix: prevent data race

refactor: make formatter public
Parse error command in a less brittle way
Emyrk pushed a commit that referenced this issue Apr 1, 2024
* feat(cli): add golden tests for errors (#11588)

Creates golden files from `coder/cli/errors.go`.
Adds a unit test to test against golden files.
Adds a make file command to regenerate golden files.
Abstracts test against golden files.
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 a pull request may close this issue.

1 participant