MCPcopy Create free account
hub / github.com/github/gh-aw / TestParseAgentLogNoAgentOutput

Function TestParseAgentLogNoAgentOutput

pkg/cli/logs_parse_test.go:14–36  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

12)
13
14func TestParseAgentLogNoAgentOutput(t *testing.T) {
15 // Create a temporary directory without agent logs
16 tempDir := testutil.TempDir(t, "test-*")
17
18 // Get the Claude engine
19 registry := workflow.GetGlobalEngineRegistry()
20 engine, err := registry.GetEngine("claude")
21 if err != nil {
22 t.Fatalf("Failed to get Claude engine: %v", err)
23 }
24
25 // Run the parser - should not fail, just skip
26 err = parseAgentLog(tempDir, engine, true)
27 if err != nil {
28 t.Fatalf("parseAgentLog should not fail when agent logs are missing: %v", err)
29 }
30
31 // Check that log.md was NOT created
32 logMdPath := filepath.Join(tempDir, "log.md")
33 if _, err := os.Stat(logMdPath); !os.IsNotExist(err) {
34 t.Fatalf("log.md should not be created when agent logs are missing")
35 }
36}
37
38func TestParseAgentLogNoEngine(t *testing.T) {
39 // Create a temporary directory with agent-stdio.log

Callers

nothing calls this directly

Calls 4

TempDirFunction · 0.92
GetGlobalEngineRegistryFunction · 0.92
parseAgentLogFunction · 0.85
GetEngineMethod · 0.80

Tested by

no test coverage detected