-
Notifications
You must be signed in to change notification settings - Fork 192
disable printing usage info for management-cluster and cluster commands if they fail even for correct command #2253
disable printing usage info for management-cluster and cluster commands if they fail even for correct command #2253
Conversation
30f0920
to
e56b47a
Compare
Cluster Generation A/B Results: |
Cluster Generation A/B Results: |
fc8f225
to
26633b3
Compare
Cluster Generation A/B Results: |
Cluster Generation A/B Results: |
Cluster Generation A/B Results: |
} | ||
|
||
func initClusterSilentModeUsecases() { | ||
createClusterNegTestSilentMode = clitest.NewTest("create cluster", "cluster create", FuncToExecAndValidateStdError) |
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.
nit: are we running each of these commands without args and relying on some being failure cases and some not to exercise the usage silencing behavior?
It may be a good idea group the test cases, and to provide some explanation what we are trying to testing 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.
All cases are failure cases only, yes it's to exercise the silentUsage. I have already grouped all silent use cases, I will update details in the comments.
changes look good, I just have a nit suggestion posted as a comment.
|
27f19e7
to
7fd9e50
Compare
Cluster Generation A/B Results: |
1e31092
to
31b0ab6
Compare
Cluster Generation A/B Results: |
Cluster Generation A/B Results: |
Cluster Generation A/B Results: |
Cluster Generation A/B Results: |
31b0ab6
to
24adcd5
Compare
@vuil I have updated the commit message (with sign and issue id) and release note in PR description. Please review it. thanks. |
Cluster Generation A/B Results: |
/test upgrade-vc7 will merge on this passing |
/test upgrade-vc7 |
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!
/test upgrade-vc7 |
24adcd5
to
e18e19c
Compare
Cluster Generation A/B Results: |
/test upgrade-vc7 |
Tests can be triggered only by the trusted reviewers (users mentioned in CODEOWNERS file). |
…entUsage:true) for management-cluster and cluster commands, their sub-commands. This gives better user experience, before this fix usage info prints always if command fails, irrespective of the issue, which is not great end user experience. More details: `tanzu cluster` and `tanzu management-cluster` commands and its sub-commands, do not print usage information in case command fails for any reason, it just prints error information. To get usage details for both `tanzu cluster` and `tanzu management-cluster` commands and their sub-commands, need to call the command or sub-commands with the flag `--help` or `-h`. eg: `tanzu cluster --help` `tanzu management-cluster create --help`
e18e19c
to
8902e74
Compare
Cluster Generation A/B Results: |
/test upgrade-vc7 |
We did rerun the BOLT test, its successful - https://gitlab.eng.vmware.com/TKG/bolt/bolt-release-yamls/-/merge_requests/2013 |
What this PR does / why we need it
tanzu commands -
tanzu cluster
and tanzumanagement-cluster
commands and their sub-commands, print usage information if the command fails irrespective of the reason, even though the input command is correct. The command might fail because of some internal or external errors, but commands still print command usage information that is misleading the end-user, it is not a great user experience.As part of this fix, the usage information will be disabled (silentUsage enabled), in case the command fails, it does not print usage information just prints error details. This is applicable for
tanzu cluster
and tanzumanagement-cluster
commands and their sub-commands.Which issue(s) this PR fixes
Fixes #1907
Describe testing done for PR
Unit test cases are written to test the silentUsage for management-cluster and cluster commands and their sub-commands.
Manual testing has been done for management-cluster and cluster commands and their sub-commands, to make sure usage information does not print if the command fails because of some internal or external errors.
Release note
PR Checklist
Additional information
Special notes for your reviewer