Repository navigation
test(scope): isolate the scope detection test from host Git config - #230
Open
chriscoveries wants to merge 2 commits into
Open
chriscoveries wants to merge 2 commits into
chriscoveries wants to merge 2 commits into
Conversation
This branch has not been deployed
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.
Problem
detected_scope_returns_the_normalized_remote_and_python_compatible_keyrunsgit initandgit remote addunder the developer's own Git configuration, so a global or system setting can change the remote the test reads back. For example, aurl."https://example.invalid/".insteadOf = git@rule in~/.gitconfigrewrites the SSH remote before the scope is derived, and the test fails on that machine while passing elsewhere.Change
GIT_CONFIG_GLOBAL), no system config, and a temporaryHOME, and plants a hostile~/.gitconfigthere to prove it does not leak in.detectpasses an empty environment list down togit_output. Production calls are unchanged and still go throughbackground_command.NULon Windows,/dev/nullelsewhere).No production behaviour changes. One file, +40/-19.
How this was tested
cargo test --locked -p cccc-pair-coreat ea7d733 on Linux x86_64 (self-hosted CI runner, 7 vCPU, 7 GiB): 502 passed, 0 failed, 1 ignored, includingscope::tests::detected_scope_returns_the_normalized_remote_and_python_compatible_key.