test(admin): cover rebalance start and stop dispatch#188
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds direct integration test coverage for the user-facing rc admin rebalance start and rc admin rebalance stop commands, ensuring their JSON output contracts and admin dispatch routes are exercised without relying on the expansion wrapper.
Changes:
- Added an integration test verifying
rc admin rebalance start <ALIAS>emits the expected JSON (including returned rebalance id) and dispatchesPOST /rustfs/admin/v3/rebalance/start. - Added an integration test verifying
rc admin rebalance stop <ALIAS>emits the expected JSON (with noidfield) and dispatchesPOST /rustfs/admin/v3/rebalance/stop.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
Related Issue
No linked issue. This is a focused test-gap follow-up for the recent admin rebalance command work.
Background
Recent changes added admin rebalance command support and then covered the direct status dispatch path. The start and stop CLI paths were still only covered indirectly through the expansion wrapper, leaving the user-facing
rc admin rebalance startandrc admin rebalance stopJSON contracts without direct integration coverage.Solution
Add direct integration tests for
rc admin rebalance startandrc admin rebalance stopusing the existing loopback admin test server pattern. The tests assert the JSON messages, target alias, returned rebalance id behavior, HTTP method, and RustFS admin route.Tests
cargo test -p rustfs-cli --test admin_rebalancemake pre-commit