Remove obsolete Git test seams - #14355
Draft
williammartin wants to merge 1 commit into
Draft
williammartin wants to merge 1 commit into
williammartin wants to merge 1 commit into
Conversation
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
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.
N/A. This is the final code layer above draft PR #14351.
Description
Layers 1-4 moved Git client tests onto real local repositories and focused command assertions, but the package still carried two subprocess mock protocols and a private
Client.commandContextproduction field used only by tests.This removes that field and its
commandCtxalias, deletes the rich JSON/environment command-mocking protocol, and replaces the remaining uses with observable real-Git state, the existingCommandModifierseam, or a narrow malformed-output parser. The one surviving subprocess helper now accepts explicit arguments instead of test-only environment variables.How did you test this change?
Not tested manually because this is a behavior-preserving cleanup of internal test infrastructure with no user-visible command change.
Key points
Client.commandContext,commandCtx,createCommandContext,createMockedCommandContext,TestHelperProcess,TestCommandMocking,commandResult,mockedCommands, and allGH_*HELPER_PROCESS*variables fromgittests.createCommitsCommandContextandTestCommitsHelperProcessalready had zero remaining definitions or callers at the layer-5 baseline.TestGitCommandHelperProcesspluscreateCommandforCommand.Outputstdout/stderr/exit behavior andrecordCommandArgsfor operation-to-auth wiring. These remain necessary to protect exact credential-helper clearing/scoping,pull --ff-only, push--set-upstream, and clone host scoping without executing a fake Git path.RemoteURLandIsIgnoredoption-separator checks to observable real-Git state. Moved malformed push-revision output to a narrow parser seam. Real missing repository directories now prove arbitrary Git error propagation.gitpackage metrics were 9.058s normal, 19.174s race, and 86.1% coverage. Final uncontended metrics were 8.074s normal, 14.688s race, and 86.4% coverage.git.IsolateConfigout ofgit/test.go: no existing internal test-support package fits, and introducing one would only relocate the productiontestingdependency while touching three consumer packages and exporting a test-only internal API.Notes for reviewers
Start with
Client.Commandingit/client.go, then review the authenticated operation tests and real-Git option-boundary scenarios ingit/client_test.go. This PR targetswilliammartin-improve-git-tests, the branch for draft PR #14351. Stack metadata is intentionally unchanged.Authorship and follow-up
Who wrote this:
Who answers review comments: