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

Function TestLoadRunSummaryMissingFile

pkg/cli/logs_summary_test.go:161–177  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

159}
160
161func TestLoadRunSummaryMissingFile(t *testing.T) {
162 // Create a temporary directory for testing
163 tmpDir := testutil.TempDir(t, "test-*")
164 runDir := filepath.Join(tmpDir, "run-12345")
165 if err := os.MkdirAll(runDir, 0755); err != nil {
166 t.Fatalf("Failed to create test directory: %v", err)
167 }
168
169 // Try to load from directory with no summary file
170 loadedSummary, ok := loadRunSummary(runDir, false)
171 if ok {
172 t.Fatal("Expected loadRunSummary to return false for missing file, but it returned true")
173 }
174 if loadedSummary != nil {
175 t.Errorf("Expected nil summary for missing file, but got: %+v", loadedSummary)
176 }
177}
178
179func TestLoadRunSummaryInvalidJSON(t *testing.T) {
180 // Create a temporary directory for testing

Callers

nothing calls this directly

Calls 3

TempDirFunction · 0.92
loadRunSummaryFunction · 0.85
ErrorfMethod · 0.45

Tested by

no test coverage detected