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

Function seedRunningAuto

internal/app/auto_test.go:184–196  ·  view source on GitHub ↗

seedRunningAuto creates an in-progress task already in auto 'running' state, as if a supervisor had just launched it.

(t *testing.T, slug string, pid int)

Source from the content-addressed store, hash-verified

182// seedRunningAuto creates an in-progress task already in auto 'running'
183// state, as if a supervisor had just launched it.
184func seedRunningAuto(t *testing.T, slug string, pid int) {
185 t.Helper()
186 db := openFlowDB(t)
187 now := flowdb.NowISO()
188 if _, err := db.Exec(
189 `UPDATE tasks SET status='in-progress', session_id=?, session_started=?,
190 auto_run_status='running', auto_run_pid=?, auto_run_started=?, updated_at=?
191 WHERE slug=?`,
192 fakeSessionID(slug), now, pid, now, now, slug,
193 ); err != nil {
194 t.Fatal(err)
195 }
196}
197
198// TestAutoExecFinalizesCompleted: when the headless session self-completes
199// (task ends up 'done' and the runner returns nil), __auto-exec records

Calls 3

NowISOFunction · 0.92
openFlowDBFunction · 0.85
fakeSessionIDFunction · 0.85

Tested by

no test coverage detected