-
Notifications
You must be signed in to change notification settings - Fork 108
Change run-test to run #901
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
Change run-test to run #901
Conversation
- CLI command updated from 'run-test' to 'run' - Legacy 'execute-test' command shows helpful suggestion to use 'run' - All unit tests pass (1317 passed, 5 skipped) - Integration tests show core functionality working (15 passed) - End-to-end CLI testing confirms proper functionality Resolves: CLI command change from run-test to run for OSB 2.0.0 Signed-off-by: Aman Ahmad <[email protected]>
osbenchmark/benchmark.py
Outdated
Check for common command mistakes and provide helpful suggestions | ||
Returns True if suggestion was provided, False otherwise | ||
""" | ||
if len(sys.argv) > 1 and sys.argv[1] == "execute-test": |
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.
This is good. One minor suggestion:
Since this method is for common command mistakes, it'd be nice to have a list of deprecated commands that this list can access. This would make the function more robust.
DEPRECATED_SUBCOMMANDS = ["execute-test", "execute"]
if len(sys.argv) > 1 and sys.argv[1] in DEPRECATED_SUBCOMMANDS:
osbenchmark/benchmark.py
Outdated
@@ -1203,6 +1216,10 @@ def main(): | |||
# Early init of console output so we start to show everything consistently. | |||
console.init(quiet=False) | |||
|
|||
# Handle command suggestions before argument parsing | |||
if handle_command_suggestions(): | |||
return |
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: would replace return
with sys.exit(1)
. While this works, sys.exit(1)
is more suitable to clearly communicate to users and developers that this error prevents the tool from operating.
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.
@aman825 Thanks for contributing this. This overall looks good. Just left a couple comments.
- Add DEPRECATED_SUBCOMMANDS list to handle_command_suggestions() for better maintainability - Change condition from hardcoded 'execute-test' to use list membership check - Replace return with sys.exit(1) for proper command-line error handling This makes it easier to add new deprecated commands and provides clearer program termination behavior with appropriate exit codes. Signed-off-by: Aman Ahmad <[email protected]>
Added the suggested changes |
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 contributing this!
Signed-off-by: Aman Ahmad <[email protected]> Co-authored-by: Aman Ahmad <[email protected]> Signed-off-by: Ian Hoang <[email protected]>
Signed-off-by: Aman Ahmad <[email protected]> Co-authored-by: Aman Ahmad <[email protected]> Signed-off-by: Ian Hoang <[email protected]>
Signed-off-by: Aman Ahmad <[email protected]> Co-authored-by: Aman Ahmad <[email protected]> Signed-off-by: Ian Hoang <[email protected]>
Signed-off-by: Aman Ahmad <[email protected]> Co-authored-by: Aman Ahmad <[email protected]> Signed-off-by: Ian Hoang <[email protected]>
Signed-off-by: Aman Ahmad <[email protected]> Co-authored-by: Aman Ahmad <[email protected]> Signed-off-by: Ian Hoang <[email protected]>
Description
Updates the CLI command from run-test to run for OpenSearch Benchmark 2.0.0. Legacy command suggestions are maintained for users who might still try the old "execute-test" command, providing helpful guidance to use the new "run" command.
Issues Resolved
#875
Testing
Unit Tests: All 1317 unit tests pass, 5 skipped - confirms no regression in core functionality
Integration Tests: 15 out of 19 integration tests pass - core benchmark functionality working correctly (4 failures are infrastructure-related, not CLI-related)
End-to-End CLI Testing:
Verified opensearch-benchmark run --help works correctly
Verified opensearch-benchmark --help shows "run" as primary command
Verified legacy command suggestion: opensearch-benchmark execute-test shows "Did you mean 'run'?" message
Tested basic CLI functionality with workload listing and command parsing
Manual Testing: Confirmed CLI command structure is correct and user-friendly error messages are displayed for legacy commands
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.