test(admin): cover pool and rebalance gaps#177
Merged
Conversation
Contributor
There was a problem hiding this comment.
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-idand correctly percent-encodes thepoolquery 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.
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(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