-
Notifications
You must be signed in to change notification settings - Fork 70
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
CLOUDP-75269: Simplify PreRunE and PreRunEOrg #505
Conversation
@gssbzn I would like to know what you think about this solution 🤔 ❓ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💯 massive effort here, just a couple of small nits with the tests for ValidateProjectID
and ValidateOrgID
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
one of my previous comments is still not addressed here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks for doing this, this was a tech debt item I've long wanted to address
t.Fatalf("PreRunE() unexpected error %v\n", err) | ||
} | ||
}) | ||
} | ||
|
||
func TestGlobalOpts_PreRunE(t *testing.T) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💯 perfect
internal/cli/global_opts_test.go
Outdated
noErrorFunc := func() error { | ||
return nil | ||
} | ||
|
||
errorFunc := func() error { | ||
return errors.New("error") | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[non-blocking] you could define each inside the test that uses it but this is not a blocking change
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Proposed changes
Jira ticket: CLOUDP-75269
Checklist
make fmt
and formatted my codeFurther comments