diff options
| author | Peter Stone <thepeterstone@gmail.com> | 2026-03-16 19:46:44 +0000 |
|---|---|---|
| committer | Peter Stone <thepeterstone@gmail.com> | 2026-03-16 19:46:44 +0000 |
| commit | 17a36cc83980d278a8cab5132bf14de731b352ca (patch) | |
| tree | 3eceb94fd0467492668692b1a0e4f840a941c9cf /internal/executor/claude_test.go | |
| parent | c2aa026f6ce1c9e216b99d74f294fc133d5fcddd (diff) | |
fix: repair test regressions and add pre-commit/pre-push verification gates
Fix four pre-existing bugs exposed after resolving a build failure:
- sandboxCloneSource: accept any URL scheme for origin remote (was filtering out https://)
- setupSandbox callers: fix := shadow variable so sandboxDir is set on BlockedError
- parseGeminiStream: parse result lines to return execution errors and cost
- TestElaborateTask_InvalidJSONFromClaude: stub Gemini fallback so test is hermetic
Add verification infrastructure:
- scripts/verify: runs go build + go test -race, used by hooks and deploy
- scripts/hooks/pre-commit: blocks commits that don't compile
- scripts/hooks/pre-push: blocks pushes where tests fail
- scripts/install-hooks: symlinks version-controlled hooks into .git/hooks/
- scripts/deploy: runs scripts/verify before building the binary
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Diffstat (limited to 'internal/executor/claude_test.go')
| -rw-r--r-- | internal/executor/claude_test.go | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/internal/executor/claude_test.go b/internal/executor/claude_test.go index 04ea6b7..e76fbf2 100644 --- a/internal/executor/claude_test.go +++ b/internal/executor/claude_test.go @@ -414,7 +414,7 @@ func TestSetupSandbox_ClonesGitRepo(t *testing.T) { src := t.TempDir() initGitRepo(t, src) - sandbox, err := setupSandbox(src) + sandbox, err := setupSandbox(src, slog.New(slog.NewTextHandler(io.Discard, nil))) if err != nil { t.Fatalf("setupSandbox: %v", err) } @@ -441,7 +441,7 @@ func TestSetupSandbox_InitialisesNonGitDir(t *testing.T) { // A plain directory (not a git repo) should be initialised then cloned. src := t.TempDir() - sandbox, err := setupSandbox(src) + sandbox, err := setupSandbox(src, slog.New(slog.NewTextHandler(io.Discard, nil))) if err != nil { t.Fatalf("setupSandbox on plain dir: %v", err) } @@ -621,12 +621,12 @@ func TestTeardownSandbox_BuildSuccess_ProceedsToAutocommit(t *testing.T) { func TestTeardownSandbox_CleanSandboxWithNoNewCommits_RemovesSandbox(t *testing.T) { src := t.TempDir() initGitRepo(t, src) - sandbox, err := setupSandbox(src) + logger := slog.New(slog.NewTextHandler(io.Discard, nil)) + sandbox, err := setupSandbox(src, logger) if err != nil { t.Fatalf("setupSandbox: %v", err) } - logger := slog.New(slog.NewTextHandler(io.Discard, nil)) execRecord := &storage.Execution{} headOut, _ := exec.Command("git", "-C", sandbox, "rev-parse", "HEAD").Output() |
