Skip to content

Test git transports with local remotes - #14350

Merged
BagToad merged 1 commit into
williammartin-git-graph-testsfrom
williammartin-git-transport-tests
Oct 30, 2026
Merged

BagToad merged 1 commit into
williammartin-git-graph-testsfrom
williammartin-git-transport-tests

Conversation

@williammartin

@williammartin williammartin commented Sep 4, 2026 •

Copy link
Copy Markdown
Member

Description

Follow on from #14349

The transport tests simulate successful commands without transferring any commits, so they cannot check the resulting refs or tracking configuration.

This PR replaces those simulations with real operations between temporary working and bare repositories. It also checks that command failures preserve partial output, the exit status and the diagnostic.

How did you test this change?

Not tested manually. The changed scenarios exercise local Git transports without using GitHub or another network service.

Key points

Transport tests use local paths and file:// URLs, so they transfer real commits without contacting GitHub or depending on network access.

Credential-helper configuration is still checked by inspecting command arguments. Local remotes do not require authentication, so a successful local transfer would not prove those arguments are correct.

Notes for reviewers

Start with the transport scenarios, then read the command failure scenario.

This builds on #14349. #14351 reduces duplication in these tests.

Authorship and follow-up

Who wrote this:

  • A human wrote it.
  • An agent wrote it under close human direction.
  • An agent wrote it independently, and no human has guided the implementation beyond the initial prompt.

Who answers review comments:

  • @williammartin will read and reply directly. Name the account.
  • An agent will draft replies and @username will read them before they are posted.
  • Nobody has explicitly committed to replying.

@williammartin williammartin mentioned this pull request Sep 4, 2026
2 of 6 tasks
@williammartin
williammartin force-pushed the williammartin-git-transport-tests branch from ff5afe5 to 4210ec6 Compare October 29, 2026 10:24
Copilot AI balanced review requested due to automatic review settings October 29, 2026 10:24

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No active review issues were identified for the Git transport test refactor.

No open issues 🎉

What changed in this PR

This test-only refactor extends the real-repository testing introduced in #14348 and #14349 to Git transport operations. It replaces broad subprocess mocks with temporary local repositories without changing production behavior.

Changes:

  • Exercise fetch, pull, push, clone, and remote configuration through real Git operations and assert repository state and failure behavior.
  • Retain focused command-construction tests for credential scope, fast-forward-only pulls, and upstream-setting pushes.
  • Extend the shared test harness with bare repositories, commits, and portable file URLs.
File Description
git/​client_test.go Converts transport tests to local Git repositories and extends the shared repository helpers.

Review effort: Balanced

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The replacement pull and push tests omit WithRepoDir cases, losing regression coverage for repository-directory modifiers used when updating existing worktrees.

2 open issues

Review effort: Balanced

Comment thread git/client_test.go Resolved
Comment thread git/client_test.go Resolved

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No active review issues remain for the test-only Git transport and command-failure coverage changes.

No open issues 🎉

2 resolved since last review

Review effort: Balanced

@williammartin
williammartin force-pushed the williammartin-git-transport-tests branch from d2995ff to 2720566 Compare October 29, 2026 20:36
@williammartin
williammartin marked this pull request as ready for review October 29, 2026 20:44
@williammartin
williammartin requested a review from a team as a code owner October 29, 2026 20:44
@BagToad
BagToad merged commit 443baeb into trunk Oct 30, 2026
18 checks passed
@BagToad
BagToad deleted the williammartin-git-transport-tests branch October 30, 2026 17:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants