[pull] trunk from cli:trunk - #215
Merged
Merged
Conversation
Matches the convention already used by internal/prompter, pkg/cmd/run/shared, and pkg/cmd/workflow/shared for their test helper files. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Config from GIT_CONFIG_COUNT and GIT_CONFIG_PARAMETERS is command line scope, which outranks both the global and system files, so pointing GIT_CONFIG_GLOBAL at an empty file was not enough on its own. An inherited safe.bareRepository=explicit made git refuse to open the bare fixtures at all. Replaces the copy of this helper in each of the two packages that needed it. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
go-gh reads GH_TOKEN and friends ahead of any stored config, so isolating the config file left tests authenticated for anyone with a token exported. Nine packages failed as a result. The token test set its own env vars before building the config, which the clearing would undo, so it now sets them after. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
The helper only ever produced an empty config, so tests needing populated hosts had to reach for the mock instead and lost the env isolation that comes with it. Test_mightBeGHESUser was one of those. Its cases named "no env vars" never cleared any, so they failed whenever GH_ENTERPRISE_TOKEN or GH_HOST was set. Its table now holds config strings rather than prebuilt configs. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Neither mock constructor had a doc comment, so nothing signalled which of the three to reach for. Each now says what it does and points at the other. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
NewBlankConfig and NewFromString gave no hint that what came back was a mock, which made them the default choice even where the real config was wanted. Every other mock constructor in the repo already announces itself, as in NewMockPrompter and NewMockFinder. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Isolate tests from local machine's auth and git configuration
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
See Commits and Changes for more details.
Created by
pull[bot] (v2.0.0-alpha.4)
Can you help keep this open source service alive? 💖 Please sponsor : )