-
Notifications
You must be signed in to change notification settings - Fork 329
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
CLI unit-testing for all commands with at least one argument #2352
Conversation
…nt upgrade guide page
@ancazamfir regarding the issues you found, I was able to fix the following:
What do you think about these fixes for the first three issues ? Regarding the ordering, it is possible to arbitrarily reorder the list of options/flags, but I am not sure which order would be better than alphabetical order. Do you have a preference for this ? I will try to reproduce the completion issue and if I manage to, try and fix it. EDIT: These changes will be done in a separate PR. |
…case with no flag
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.
❤️ these unit tests! Great job, @ljoss17 🎉
value_name = "A_CONNECTION_ID", | ||
help = "Identifier of the connection on chain `a` to use in creating the new channel." | ||
required = true, | ||
groups = &["b_chain_group", "new_client_group"], |
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.
Sweet :)
…lsystems#2352) * Adding unit tests for all Hermes commands with at least one argument. * Instead of manually validating the flags, the validation is done by `clap` for commands `create channel`, `create connection`, `keys add` and `keys delete`. * Minor changes to the guide. * Updated the ADR 010 with the new `--yes` optional flag for the command `create channel`. --- * Updated CLI commands to take flags everywhere and updated e2e tests accordingly * Updated gm to use flags when calling Hermes * Added missing flags to e2e test for 'query client state' command * Fixed flag errors in e2e tests and removed conflicting short flag. * Removed all short flags and updated CLI commands comments * Removed forgotten short flags. * Updated Hermes guide with flags instead of positional arguments * Updated script and comment with new long flags for Hermes * Completed 'tx raw upgrade-' commands guide page. Updated Testing client upgrade guide page * Added changelog entry * Added example unit-tests to the 'keys add' command * Added value names to parameters and removed cli parsing unit-tests * Cargo fmt changes * Updated flags in order to reflect ADR 010 * Updated guide to reflect flag changes from ADR 010 * Updated gm script and e2e tests to match flag changes from ADR 010 * Fixed ADR 010 typo * Added unit-testing CLI argument parsing * Updated unit tests for CLI and improved help output * Improved 'override_usage' for commands with multiple usages * Updated Hermes guide. Removed changes for issue informalsystems#2349, they will be added in a separate PR. * Removed manual validation for 'keys add' and 'keys delete' flags. * Added changelog entry * Updated unit tests for command 'clear packets' to include new optional flags * Cargo fmt * Fixed 'keys add' in ADR 010 and added shell completion unit test for case with no flag * Fix clippy warnings introduced in Rust 1.62 Co-authored-by: Romain Ruetschi <romain@informal.systems>
Closes: #2358
Description
This PR adds unit-testing parsing Hermes commands,
as well as improving the commands help output.. Changes for issue #2349 will be done in a separate PR.The help output follows the request from issue #2349
Changes
This PR has the following changes:
clap
for commandscreate channel
,create connection
,keys add
andkeys delete
.--yes
optional flag for the commandcreate channel
.PR author checklist:
unclog
.docs/
).Reviewer checklist:
Files changed
in the GitHub PR explorer.