diff options
| author | Peter Stone <thepeterstone@gmail.com> | 2026-03-08 06:43:06 +0000 |
|---|---|---|
| committer | Peter Stone <thepeterstone@gmail.com> | 2026-03-08 06:43:06 +0000 |
| commit | 0ff0bf75544bbf565288e61bb8e10c3f903830f8 (patch) | |
| tree | 302f152b14d3ef2a81cfebdb4925d41e734ab8d5 /internal/executor/executor_test.go | |
| parent | 5d6d79e8925693c0740d8c31c614396d70dfb8a5 (diff) | |
refactor: address code review notes (backward compat, Gemini tests, unknown agent test)
Diffstat (limited to 'internal/executor/executor_test.go')
| -rw-r--r-- | internal/executor/executor_test.go | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/internal/executor/executor_test.go b/internal/executor/executor_test.go index 2f205f8..9ad0617 100644 --- a/internal/executor/executor_test.go +++ b/internal/executor/executor_test.go @@ -346,3 +346,29 @@ func TestPool_ConcurrentExecution(t *testing.T) { t.Errorf("calls: want 3, got %d", runner.callCount()) } } + +func TestPool_UnsupportedAgent(t *testing.T) { + store := testStore(t) + runners := map[string]Runner{"claude": &mockRunner{}} + logger := slog.New(slog.NewTextHandler(os.Stderr, &slog.HandlerOptions{Level: slog.LevelError})) + pool := NewPool(2, runners, store, logger) + + tk := makeTask("bad-agent") + tk.Agent.Type = "super-ai" + store.CreateTask(tk) + + if err := pool.Submit(context.Background(), tk); err != nil { + t.Fatalf("submit: %v", err) + } + + result := <-pool.Results() + if result.Err == nil { + t.Fatal("expected error for unsupported agent") + } + if !strings.Contains(result.Err.Error(), "unsupported agent type") { + t.Errorf("expected 'unsupported agent type' in error, got: %v", result.Err) + } + if result.Execution.Status != "FAILED" { + t.Errorf("status: want FAILED, got %q", result.Execution.Status) + } +} |
