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

Function TestParseAgentLogNoEngine

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

Source from the content-addressed store, hash-verified

36}
37
38func TestParseAgentLogNoEngine(t *testing.T) {
39 // Create a temporary directory with agent-stdio.log
40 tempDir := testutil.TempDir(t, "test-*")
41
42 agentStdioPath := filepath.Join(tempDir, "agent-stdio.log")
43 if err := os.WriteFile(agentStdioPath, []byte("[]"), 0644); err != nil {
44 t.Fatalf("Failed to create mock agent-stdio.log: %v", err)
45 }
46
47 // Run the parser with nil engine - should skip gracefully
48 err := parseAgentLog(tempDir, nil, true)
49 if err != nil {
50 t.Fatalf("parseAgentLog should not fail with nil engine: %v", err)
51 }
52
53 // Check that log.md was NOT created
54 logMdPath := filepath.Join(tempDir, "log.md")
55 if _, err := os.Stat(logMdPath); !os.IsNotExist(err) {
56 t.Fatalf("log.md should not be created when engine is nil")
57 }
58}

Callers

nothing calls this directly

Calls 2

TempDirFunction · 0.92
parseAgentLogFunction · 0.85

Tested by

no test coverage detected