Repository navigation
Improve git client tests - #14351
Merged
BagToad merged 1 commit intoOct 30, 2026
Merged
Improve git client tests#14351
Conversation
2 of 6 tasks
williammartin
force-pushed
the
williammartin-improve-git-tests
branch
from
October 29, 2026 10:24
0c11bdf to
00d139a
Compare
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
The error-message check in git/command_test.go uses a nonfatal assertion, contrary to AGENTS.md’s requirement for fatal error checks.
1 open issue
What changed in this PR
This test-only follow-up to #14350 simplifies the Git client suite after its move to local repositories. Production code is unchanged.
Changes:
- Replace temporary executable builds with the existing helper-process setup for command output tests.
- Reduce redundant remote setup and separate success and failure scenarios.
- Clarify parser and value tests with Given/When/Then structure and stronger assertions.
| File | Description |
|---|---|
| git/url_test.go | Remove redundant URL variation and separate malformed-input coverage. |
| git/command_test.go | Reuse helper processes to test output and Git errors without nested builds. |
| git/client_test.go | Simplify repository setup, split scenarios, and clarify assertions. |
Review effort: Balanced
williammartin
force-pushed
the
williammartin-improve-git-tests
branch
from
October 29, 2026 11:49
a0965e2 to
737ffb5
Compare
2 of 6 tasks
williammartin
force-pushed
the
williammartin-improve-git-tests
branch
from
October 29, 2026 19:24
737ffb5 to
3764002
Compare
Co-authored-by: Copilot App <[email protected]>
williammartin
force-pushed
the
williammartin-improve-git-tests
branch
from
October 29, 2026 20:39
628fe6b to
5714558
Compare
williammartin
marked this pull request as ready for review
October 29, 2026 20:44
BagToad
approved these changes
Oct 30, 2026
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.

Description
Follow on from #14350
Several tests put successful operations and errors in the same table, which makes the setup and assertions branch on the expected outcome. Other tests repeat equivalent cases or compile a separate executable just to return fixed output.
This PR separates success and failure cases, removes duplicate setup and uses the existing subprocess helper for
Command.Outputtests.How did you test this change?
Not tested manually. This simplifies tests without changing production code.
Key points
Command output tests keep a small subprocess helper so they can control standard output, standard error and the exit code without compiling another executable. The client tests continue to use real Git repositories.
Notes for reviewers
Start with the command scenarios, then read the smaller remote setup and separated URL parsing scenarios.
This builds on #14350. #14355 removes the remaining obsolete process-mocking infrastructure.
Authorship and follow-up
Who wrote this:
Who answers review comments: