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)
| 13 | // fixed pid and never spawns a real supervisor. Returns accessors for |
| 14 | // the captured slug / workDir / logPath / injection and the call count. |
| 15 | func 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 |
no outgoing calls
no test coverage detected