test(cli): cover noun-first stat and share help#127
Draft
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This change adds focused contract coverage for the noun-first object commands introduced in the recent bucket/object command-group work. The existing help contract suite already covered
rc object copyandrc object show, but it did not assert discoverability for delegatedrc object statandrc object sharesubcommands, and there was no direct parser test forrc object stat.Root cause
The noun-first command groups were added with thin delegation to the existing command implementations, but only a subset of those delegated paths received fast parser/help coverage. That left a gap where regressions in
rc object statorrc object sharediscoverability could slip through even though those commands are part of the user-facing noun-first surface.Fix
The help contract test matrix now includes
rc object stat --helpandrc object share --help, asserting the usage shape and their key option tokens. The CLI unit tests also now parserc object stat local/my-bucket/report.jsonand verify it routes toObjectCommands::Statwith the expected path.Validation
I first ran focused tests for the touched areas:
cargo test -p rustfs-cli --test help_contract nested_subcommand_help_contractcargo test -p rustfs-cli cli_accepts_object_stat_subcommandI then ran the repository's documented checks:
cargo fmt --all --checkcargo clippy --workspace -- -D warningscargo test --workspaceI also attempted
make pre-commitbecause the automation requested it, but this repository currently has noMakefileorpre-committarget, so that exact command cannot be executed in this checkout.