MCPcopy Create free account
hub / github.com/Facets-cloud/flow / TestListTasksKindOverride

Function TestListTasksKindOverride

internal/app/list_test.go:457–480  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

455}
456
457func 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
482func TestListTasksKindAll(t *testing.T) {
483 setupFlowRoot(t)

Callers

nothing calls this directly

Calls 7

UpsertPlaybookFunction · 0.92
NowISOFunction · 0.92
setupFlowRootFunction · 0.85
openFlowDBFunction · 0.85
fakeSessionIDFunction · 0.85
captureShowStdoutFunction · 0.85
cmdListFunction · 0.85

Tested by

no test coverage detected