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

Function stubAutoLauncher

internal/app/auto_test.go:15–27  ·  view source on GitHub ↗

stubAutoLauncher replaces autoLauncher with a recorder that returns a fixed pid and never spawns a real supervisor. Returns accessors for the captured slug / workDir / logPath / injection and the call count.

(t *testing.T, pid int)

Source from the content-addressed store, hash-verified

13// fixed pid and never spawns a real supervisor. Returns accessors for
14// the captured slug / workDir / logPath / injection and the call count.
15func stubAutoLauncher(t *testing.T, pid int) (calls *int, slug, workDir, logPath, injection *string) {
16 t.Helper()
17 var n int
18 var s, wd, lp, inj string
19 old := autoLauncher
20 autoLauncher = func(gotSlug, gotWorkDir, gotLog, gotInjection string, env []string) (int, error) {
21 n++
22 s, wd, lp, inj = gotSlug, gotWorkDir, gotLog, gotInjection
23 return pid, nil
24 }
25 t.Cleanup(func() { autoLauncher = old })
26 return &n, &s, &wd, &lp, &inj
27}
28
29// TestCmdDoAutoLaunchesDetached pins the core --auto behavior: no terminal
30// tab is spawned, the detached supervisor launcher is invoked, and the

Calls

no outgoing calls

Tested by

no test coverage detected