Skip to content

test(admin): cover pool and rebalance gaps#177

Merged
overtrue merged 1 commit intomainfrom
codex/test-admin-route-gaps
May 6, 2026
Merged

test(admin): cover pool and rebalance gaps#177
overtrue merged 1 commit intomainfrom
codex/test-admin-route-gaps

Conversation

@overtrue
Copy link
Copy Markdown
Contributor

@overtrue overtrue commented May 6, 2026

Related issue(s)

None. This is a focused test-gap follow-up for the recent admin pool, decommission, and rebalance command work.

Background and impact

The new admin pool and rebalance commands already had parser and route coverage, but several local formatting and state branches were still only lightly exercised. Those branches decide how decommission terminal states, byte sizes, durations, and rebalance statuses are presented to users.

Root cause

The initial coverage focused on command discovery and the primary S3 admin API routes. It did not cover the non-by-id pool status command-line query variant, failed and canceled decommission states, larger byte units, or the rebalance status styling branches.

Solution

This adds focused tests for the uncovered admin paths without changing runtime behavior. The S3 admin test now asserts the command-line pool query path omits by-id and encodes the pool value correctly. The CLI tests now cover decommission terminal states, GiB and TiB byte formatting, duration boundaries, and rebalance status variants with color disabled for stable assertions.

Validation

  • cargo test -p rc-s3 test_pool_status_uses_command_line_query_without_by_id --lib
  • cargo test -p rustfs-cli admin::pool::tests --lib
  • cargo test -p rustfs-cli admin::rebalance::tests --lib
  • make pre-commit

@overtrue overtrue marked this pull request as ready for review May 6, 2026 20:16
Copilot AI review requested due to automatic review settings May 6, 2026 20:16
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 focused test coverage for previously unexercised admin pool and rebalance formatting/state branches, improving confidence in user-facing output without changing runtime behavior.

Changes:

  • Add an S3 admin client test ensuring the pool status “cmdline query” path omits by-id and correctly percent-encodes the pool query value.
  • Expand CLI pool tests to cover default, failed, and canceled decommission terminal states plus larger byte-unit formatting (GiB/TiB).
  • Expand CLI rebalance tests to cover additional duration boundaries, larger byte units, and status styling branches with color disabled for stable assertions.

Reviewed changes

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

File Description
crates/s3/src/admin.rs Adds coverage for pool status requests when targeting pools by command line (no by-id), including URL encoding validation.
crates/cli/src/commands/admin/rebalance.rs Adds tests for duration/byte formatting boundaries and status styling behavior with colors disabled.
crates/cli/src/commands/admin/pool.rs Adds tests for additional decommission terminal states and larger byte-unit formatting branches.

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

@overtrue overtrue merged commit d3988ef into main May 6, 2026
19 checks passed
@overtrue overtrue deleted the codex/test-admin-route-gaps branch May 6, 2026 20:27
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