Skip to content

Commit c8cf6f8

Browse files
committed
reuse runReporter for the non-TUI interactive report file
The interactive branch hand-rolled the temp-file report and omitted the broken-agent note, agent log path, and dashboard URL that the TUI's report file includes via runReporter.Finish.
1 parent f9d81d2 commit c8cf6f8

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

cmd/lk/simulate_ci.go

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -177,10 +177,9 @@ func runSimulateCI(ctx context.Context, config *simulateConfig) error {
177177
// A terminal is watching; we just couldn't open the TUI (e.g. stdin
178178
// isn't a TTY). Keep it to counts and pointers, the per-scenario
179179
// transcripts go to a report file like the TUI's.
180-
if f, err := os.CreateTemp("", "lk-simulate-report-*.txt"); err == nil {
181-
writeRunResults(asciiWriter{f}, run, agent)
182-
f.Close()
183-
out.Statusf("Run report: %s", f.Name())
180+
dashboardURL := simulationDashboardURL(config.pc.ProjectId, runID)
181+
if path := newRunReporter().Finish(run, agent, brokenAgent, dashboardURL); path != "" {
182+
out.Statusf("Run report: %s", path)
184183
}
185184
total, _, passed, failedN := simulationJobCounts(run)
186185
fmt.Fprintf(out.ResultWriter(), "%d total, %d passed, %d failed\n", total, passed, failedN)

0 commit comments

Comments
 (0)