Skip to content
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

Generate acceptance tests for help output for all CLI commands #2260

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

andrewnester
Copy link
Contributor

Changes

This PR helps to make sure that there is no unexpected issues in help output.

It automatically generates scripts used for acceptance test for all CLI commands with --help flag.

If there's any changes to the output, the test output will be autogenerated and can be reviewed later as part of CLI regeneration PR

"services": {
".codegen/service.go.tmpl": "cmd/{{if .IsAccounts}}account{{else}}workspace{{end}}/{{(.TrimPrefix \"account\").KebabName}}/{{(.TrimPrefix \"account\").KebabName}}.go"
".codegen/service.go.tmpl": "cmd/{{if .IsAccounts}}account{{else}}workspace{{end}}/{{(.TrimPrefix \"account\").KebabName}}/{{(.TrimPrefix \"account\").KebabName}}.go",
".codegen/cmd_script.tmpl": "acceptance/help/cmd/{{if .IsAccounts}}account{{else}}workspace{{end}}/{{(.TrimPrefix \"account\").KebabName}}/{{(.TrimPrefix \"account\").KebabName}}/script"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This repeats the KebabName twice. Intentional or can we use 1x?

"post_generate": [
"go test ./acceptance -v -update -run 'TestAccept/help/cmd' ",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Trailing whitespace + quotes are not needed.

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.

2 participants