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

Function TestCmdRunPlaybookHereInvalidUUID

internal/app/run_test.go:309–329  ·  view source on GitHub ↗

TestCmdRunPlaybookHereInvalidUUID pins UUID-shape validation. An env var that isn't a v4 UUID is rejected; no dangling row created.

(t *testing.T)

Source from the content-addressed store, hash-verified

307// TestCmdRunPlaybookHereInvalidUUID pins UUID-shape validation. An
308// env var that isn't a v4 UUID is rejected; no dangling row created.
309func TestCmdRunPlaybookHereInvalidUUID(t *testing.T) {
310 setupFlowRoot(t)
311 wd := t.TempDir()
312 if rc := cmdAdd([]string{"playbook", "P", "--slug", "p", "--work-dir", wd}); rc != 0 {
313 t.Fatal()
314 }
315 t.Setenv("CLAUDE_CODE_SESSION_ID", "not-a-uuid")
316 stubITerm(t)
317
318 if rc := cmdRun([]string{"playbook", "p", "--here"}); rc != 1 {
319 t.Errorf("rc=%d, want 1 when env is not a valid UUID", rc)
320 }
321 db := openFlowDB(t)
322 var n int
323 if err := db.QueryRow(`SELECT COUNT(*) FROM tasks WHERE kind='playbook_run'`).Scan(&n); err != nil {
324 t.Fatal(err)
325 }
326 if n != 0 {
327 t.Errorf("no run row should be created on UUID validation failure; got %d", n)
328 }
329}
330
331// TestCmdRunPlaybookHereRejectsCurrentSessionAlreadyBoundElsewhere
332// pins the session_id uniqueness invariant: if the current session

Callers

nothing calls this directly

Calls 5

setupFlowRootFunction · 0.85
cmdAddFunction · 0.85
stubITermFunction · 0.85
cmdRunFunction · 0.85
openFlowDBFunction · 0.85

Tested by

no test coverage detected