(t *testing.T)
| 455 | } |
| 456 | |
| 457 | func TestListTasksKindOverride(t *testing.T) { |
| 458 | setupFlowRoot(t) |
| 459 | db := openFlowDB(t) |
| 460 | wd := t.TempDir() |
| 461 | if err := flowdb.UpsertPlaybook(db, &flowdb.Playbook{Slug: "pb", Name: "PB", WorkDir: wd}); err != nil { |
| 462 | t.Fatal(err) |
| 463 | } |
| 464 | now := flowdb.NowISO() |
| 465 | if _, err := db.Exec( |
| 466 | `INSERT INTO tasks (slug, name, status, kind, playbook_slug, priority, work_dir, session_id, created_at, updated_at) |
| 467 | VALUES ('pb--2026-04-30-10-30', 'r', 'in-progress', 'playbook_run', 'pb', 'medium', ?, ?, ?, ?)`, |
| 468 | wd, fakeSessionID("pb--2026-04-30-10-30"), now, now, |
| 469 | ); err != nil { |
| 470 | t.Fatal(err) |
| 471 | } |
| 472 | out := captureShowStdout(t, func() { |
| 473 | if rc := cmdList([]string{"tasks", "--kind", "playbook_run"}); rc != 0 { |
| 474 | t.Fatal() |
| 475 | } |
| 476 | }) |
| 477 | if !strings.Contains(out, "pb--2026-04-30-10-30") { |
| 478 | t.Errorf("--kind playbook_run should show runs:\n%s", out) |
| 479 | } |
| 480 | } |
| 481 | |
| 482 | func TestListTasksKindAll(t *testing.T) { |
| 483 | setupFlowRoot(t) |
nothing calls this directly
no test coverage detected