From c9a9eaf1dcf8795216ff91c76192c7318272a990 Mon Sep 17 00:00:00 2001 From: Michael Chus Date: Sat, 12 Sep 2026 16:46:36 +0300 Subject: [PATCH] test: cover cpu audit reanimator workflow --- cmd/logpile-cpu-audit/main_test.go | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/cmd/logpile-cpu-audit/main_test.go b/cmd/logpile-cpu-audit/main_test.go index ddd96d3..ddfaf33 100644 --- a/cmd/logpile-cpu-audit/main_test.go +++ b/cmd/logpile-cpu-audit/main_test.go @@ -128,3 +128,28 @@ func TestRunAuditWritesFailureReportAndSummary(t *testing.T) { } } } + +func TestCollectAuditJobsAndReanimatorNoCPU(t *testing.T) { + input := t.TempDir() + output := filepath.Join(input, "output") + plain := filepath.Join(input, "nvidia-bug-report.log") + if err := os.WriteFile(plain, []byte("NVIDIA bug report log file\nnvidia-bug-report.sh\n"), 0o644); err != nil { + t.Fatalf("write fixture: %v", err) + } + + jobs, err := collectAuditJobs(input, output, true, true) + if err != nil { + t.Fatalf("collectAuditJobs: %v", err) + } + if len(jobs) != 1 || jobs[0].relative != "nvidia-bug-report.log" { + t.Fatalf("unexpected jobs: %+v", jobs) + } + + summary, err := runReanimatorExport(input, output, "v1", 1, true) + if err != nil { + t.Fatalf("runReanimatorExport: %v", err) + } + if summary.FilesFound != 1 || summary.FilesParsed != 1 || summary.FilesNoCPU != 1 || summary.FilesWithCPU != 0 { + t.Fatalf("unexpected summary: %+v", summary) + } +}