Skip to content

test(admin): cover rebalance start and stop dispatch#188

Merged
overtrue merged 1 commit intomainfrom
codex/test-rebalance-start-stop-dispatch
May 8, 2026
Merged

test(admin): cover rebalance start and stop dispatch#188
overtrue merged 1 commit intomainfrom
codex/test-rebalance-start-stop-dispatch

Conversation

@overtrue
Copy link
Copy Markdown
Contributor

@overtrue overtrue commented May 8, 2026

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 start and rc admin rebalance stop JSON contracts without direct integration coverage.

Solution

Add direct integration tests for rc admin rebalance start and rc admin rebalance stop using 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_rebalance
  • make pre-commit

@overtrue overtrue marked this pull request as ready for review May 8, 2026 12:20
Copilot AI review requested due to automatic review settings May 8, 2026 12:20
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 dispatches POST /rustfs/admin/v3/rebalance/start.
  • Added an integration test verifying rc admin rebalance stop <ALIAS> emits the expected JSON (with no id field) and dispatches POST /rustfs/admin/v3/rebalance/stop.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@overtrue overtrue merged commit 43fdd82 into main May 8, 2026
19 checks passed
@overtrue overtrue deleted the codex/test-rebalance-start-stop-dispatch branch May 8, 2026 12:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants