add tests that validate git remote related flows#696
Conversation
Entire-Checkpoint: 932826e00ea3
PR SummaryLow Risk Overview Extends the integration Adds unit tests in Written by Cursor Bugbot for commit 3c059e3. Configure here. |
There was a problem hiding this comment.
Pull request overview
Adds unit and integration coverage for git-remote–related checkpoint/trails push flows in Entire CLI, focusing on pre-push behavior, routing/fallback logic, and non-fast-forward recovery.
Changes:
- Expanded strategy unit tests around pushing metadata branches to unreachable/local targets.
- Added new
TestEnvhelpers for creating bare remotes, cloning, pushing/fetching, and running the pre-push hook. - Introduced a comprehensive integration test suite validating pre-push outcomes (checkpoint/trails pushes, routing, clone+resume, and concurrent push merge recovery).
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 6 comments.
| File | Description |
|---|---|
| cmd/entire/cli/strategy/push_common_test.go | Adds unit tests for graceful push failure and local bare-repo push success cases. |
| cmd/entire/cli/integration_test/testenv.go | Adds integration helpers for bare remotes, cloning, settings patching, and pre-push execution. |
| cmd/entire/cli/integration_test/remote_operations_test.go | Adds integration tests covering pre-push push behavior, routing/fallback, clone+resume flows, and non-fast-forward recovery. |
You can also share your feedback on Copilot code review. Take the survey.
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix prepared a fix for the issue found in the latest run.
- ✅ Fixed: Unused
GitFetchmethod is dead code- Removed the unused GitFetch method from TestEnv since it is never called anywhere in the codebase; all fetching uses FetchMetadataBranch instead.
Or push these changes by commenting:
@cursor push 3dbf40d88d
Preview (3dbf40d88d)
diff --git a/cmd/entire/cli/integration_test/testenv.go b/cmd/entire/cli/integration_test/testenv.go
--- a/cmd/entire/cli/integration_test/testenv.go
+++ b/cmd/entire/cli/integration_test/testenv.go
@@ -1792,19 +1792,6 @@
}
}
-// GitFetch fetches from a remote. Fails the test on error.
-func (env *TestEnv) GitFetch(remote string, args ...string) {
- env.T.Helper()
-
- cmdArgs := append([]string{"fetch", remote}, args...)
- cmd := exec.CommandContext(context.Background(), "git", cmdArgs...)
- cmd.Dir = env.RepoDir
- cmd.Env = testutil.GitIsolatedEnv()
- if output, err := cmd.CombinedOutput(); err != nil {
- env.T.Fatalf("git fetch %s failed: %v\n%s", remote, err, output)
- }
-}
-
// RunPrePush runs the pre-push hook via the CLI binary, consistent with how
// other CLI invocations (GitCommitWithShadowHooks, RunCLI) use env.cliEnv().
func (env *TestEnv) RunPrePush(remote string) {This Bugbot Autofix run was free. To enable autofix for future PRs, go to the Cursor dashboard.
Comment @cursor review or bugbot run to trigger another review on this PR
Entire-Checkpoint: 6dcf16e1b2ba
Entire-Checkpoint: 0aae6535a959


So far our integration tests did not cover pushing or pulling from/to a remote. This adds this now using a local remote.