test(alias): cover RC_HOST alias resolution#179
Merged
Conversation
Contributor
There was a problem hiding this comment.
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, runsrc --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.
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
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 myaliaswithout storing credentials in the config file. Existing coverage verified thatalias list --jsonincludes an environment alias and redacts credentials, but it did not exercise the primary command-resolution path that loads an alias throughAliasManager::get.Solution
Add a focused CLI integration test for
rc --json ls myaliaswithRC_HOST_myaliaspointing 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 returningAlias 'myalias' not found.Validation
cargo test -p rustfs-cli --test env_aliasmake pre-commit