diff options
| author | Peter Stone <thepeterstone@gmail.com> | 2026-03-24 21:54:31 +0000 |
|---|---|---|
| committer | Peter Stone <thepeterstone@gmail.com> | 2026-03-24 21:54:31 +0000 |
| commit | 407fbc8d346b986bf864452c865282aa726272e2 (patch) | |
| tree | 274aa7861a6e4316c1919e93d944023d60846b44 /internal/executor/container_test.go | |
| parent | e3954992af63440986bd39cce889e9c62e1a6b92 (diff) | |
| parent | b2e77009c55ba0f07bb9ff904d9f2f6cc9ff0ee2 (diff) | |
fix: resolve merge conflict — integrate agent's story-aware ContainerRunner
Agent added: Store on ContainerRunner (direct story/project lookup), --reference
clone for speed, explicit story branch push, checkStoryCompletion → SHIPPABLE.
My additions: BranchName on Task as fallback when Store is nil, tests updated
to match checkout-after-clone approach.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Diffstat (limited to 'internal/executor/container_test.go')
| -rw-r--r-- | internal/executor/container_test.go | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/internal/executor/container_test.go b/internal/executor/container_test.go index c56d1b2..15c147f 100644 --- a/internal/executor/container_test.go +++ b/internal/executor/container_test.go @@ -518,18 +518,23 @@ func TestContainerRunner_AuthError_SyncsAndRetries(t *testing.T) { func TestContainerRunner_ClonesStoryBranch(t *testing.T) { logger := slog.New(slog.NewTextHandler(io.Discard, nil)) - var cloneArgs []string + var checkoutArgs []string runner := &ContainerRunner{ Logger: logger, Image: "busybox", Command: func(ctx context.Context, name string, arg ...string) *exec.Cmd { if name == "git" && len(arg) > 0 && arg[0] == "clone" { - cloneArgs = append([]string{}, arg...) dir := arg[len(arg)-1] os.MkdirAll(dir, 0755) return exec.Command("true") } - // docker run fails so the test exits quickly + // Capture checkout calls: both "git checkout <branch>" and "git -C <dir> checkout <branch>" + for i, a := range arg { + if a == "checkout" { + checkoutArgs = append([]string{}, arg[i:]...) + break + } + } if name == "docker" { return exec.Command("sh", "-c", "exit 1") } @@ -548,19 +553,19 @@ func TestContainerRunner_ClonesStoryBranch(t *testing.T) { runner.Run(context.Background(), tk, e) os.RemoveAll(e.SandboxDir) - // Assert git clone was called with --branch <branchName> - if len(cloneArgs) < 3 { - t.Fatalf("expected clone args, got %v", cloneArgs) + // Assert git checkout was called with the story branch name. + if len(checkoutArgs) == 0 { + t.Fatal("expected git checkout to be called for story branch, but it was not") } found := false - for i, a := range cloneArgs { - if a == "--branch" && i+1 < len(cloneArgs) && cloneArgs[i+1] == "story/my-feature" { + for _, a := range checkoutArgs { + if a == "story/my-feature" { found = true break } } if !found { - t.Errorf("expected git clone --branch story/my-feature, got args: %v", cloneArgs) + t.Errorf("expected git checkout story/my-feature, got args: %v", checkoutArgs) } } |
