Skip to content

Commit b0e5616

Browse files
committed
test(tools): add codex integration test gated on PATH detection
Skips gracefully if codex is not installed or not authenticated.
1 parent b77a49f commit b0e5616

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

agent/tools/agent_runner_test.go

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -213,3 +213,28 @@ func TestAgentRunner_RealGemini(t *testing.T) {
213213
t.Error("expected non-empty output")
214214
}
215215
}
216+
217+
func TestAgentRunner_RealCodex(t *testing.T) {
218+
if _, err := exec.LookPath("codex"); err != nil {
219+
t.Skip("codex not on PATH")
220+
}
221+
agents := DetectAgents()
222+
var info AgentInfo
223+
for _, a := range agents {
224+
if a.Kind == AgentCodex {
225+
info = a
226+
break
227+
}
228+
}
229+
r := NewAgentRunner(info)
230+
out, err := r.Run(context.Background(), "Say hello in exactly one word.", 30*time.Second)
231+
if err != nil {
232+
if strings.Contains(err.Error(), "auth") || strings.Contains(err.Error(), "API key") || strings.Contains(err.Error(), "login") {
233+
t.Skipf("codex auth not configured: %v", err)
234+
}
235+
t.Fatalf("Run: %v", err)
236+
}
237+
if out == "" {
238+
t.Error("expected non-empty output")
239+
}
240+
}

0 commit comments

Comments
 (0)