Skip to content

test(admin): cover decommission CLI dispatch#189

Open
overtrue wants to merge 1 commit intomainfrom
codex/test-admin-decommission-dispatch
Open

test(admin): cover decommission CLI dispatch#189
overtrue wants to merge 1 commit intomainfrom
codex/test-admin-decommission-dispatch

Conversation

@overtrue
Copy link
Copy Markdown
Contributor

@overtrue overtrue commented May 8, 2026

Summary

This PR adds focused CLI integration coverage for the admin decommission workflow introduced with pool decommissioning support.

Background

The lower-level admin client already had route tests for decommission start and cancel, and the CLI parser covered the command shapes. The missing path was the real rc admin decommission binary dispatch through alias resolution, JSON output formatting, and signed admin route selection.

Changes

  • Added non-Windows integration tests for admin decommission start, admin decommission status, and the admin decom cancel alias.
  • Asserted the generated JSON payloads and captured admin API method, route, and query strings.
  • Fixed the recently added rebalance integration test server helper to switch accepted sockets back to blocking mode before reading, preventing a race seen during the full pre-commit run.

Validation

  • cargo fmt --all --check
  • cargo test -p rustfs-cli --test admin_decommission
  • cargo test -p rustfs-cli --test admin_rebalance --test admin_decommission
  • make pre-commit

@overtrue overtrue marked this pull request as ready for review May 8, 2026 16:17
Copilot AI review requested due to automatic review settings May 8, 2026 16:17
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 CLI integration coverage for the rc admin decommission workflow (including the decom alias) and hardens the admin test TCP server helper to avoid a nonblocking-read race during full test runs.

Changes:

  • Added new non-Windows integration tests covering admin decommission start, admin decommission status, and admin decom cancel, asserting JSON output and the dispatched admin route/method/query.
  • Fixed the admin_rebalance test server helper by switching the accepted socket back to blocking mode before reading the request.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
crates/cli/tests/admin_rebalance.rs Ensures the accepted TCP stream is blocking before request parsing to prevent flaky nonblocking reads.
crates/cli/tests/admin_decommission.rs New integration tests verifying CLI dispatch/aliasing and JSON output for the decommission admin workflow.

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

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