Skip to content

test(alias): cover RC_HOST alias resolution#179

Merged
overtrue merged 1 commit intomainfrom
codex/test-env-alias-edge-cases
May 7, 2026
Merged

test(alias): cover RC_HOST alias resolution#179
overtrue merged 1 commit intomainfrom
codex/test-env-alias-edge-cases

Conversation

@overtrue
Copy link
Copy Markdown
Contributor

@overtrue overtrue commented May 7, 2026

Related

Follow-up test-gap coverage for recent RC_HOST_<ALIAS> environment alias support.

Background

PR #176 added temporary aliases through environment variables so users can run commands such as rc ls myalias without storing credentials in the config file. Existing coverage verified that alias list --json includes an environment alias and redacts credentials, but it did not exercise the primary command-resolution path that loads an alias through AliasManager::get.

Solution

Add a focused CLI integration test for rc --json ls myalias with RC_HOST_myalias pointing at an unused local endpoint. The expected network-class failure proves the command resolved the environment alias and attempted to use its endpoint instead of returning Alias 'myalias' not found.

Validation

  • cargo test -p rustfs-cli --test env_alias
  • make pre-commit

@overtrue overtrue marked this pull request as ready for review May 7, 2026 04:15
@overtrue overtrue merged commit b8345bd into main May 7, 2026
15 checks passed
@overtrue overtrue deleted the codex/test-env-alias-edge-cases branch May 7, 2026 06:00
Copilot AI review requested due to automatic review settings May 7, 2026 06:41
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 missing CLI integration coverage to ensure RC_HOST_<ALIAS> environment aliases participate in the primary alias resolution path (AliasManager::get) when running a normal command (rc --json ls <alias>), not just alias list --json.

Changes:

  • Introduces a helper to generate a local unused endpoint for deterministic network failure.
  • Adds an integration test that sets RC_HOST_myalias, runs rc --json ls myalias, and asserts a network-class JSON error (instead of “Alias not found”).

💡 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