mirror of
https://github.com/garrytan/gstack.git
synced 2026-09-18 19:02:18 +02:00
test(gbrain-sync): stub pgrep so the pin case is hermetic
The only non-dry-run --code-only child hits #1734's PATH-resolved autopilot probe. A live host daemon is a correct refuse; the test cannot inject processRunning. Neutralize pgrep in the fixture bindir instead of adding a production env hatch. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
committed by
Garry Tan
co-authored by
Cursor
parent
ddcd4073ef
commit
924744fed9
@@ -192,6 +192,13 @@ case "$*" in
|
|||||||
esac
|
esac
|
||||||
`);
|
`);
|
||||||
chmodSync(join(bindir, "gbrain"), 0o755);
|
chmodSync(join(bindir, "gbrain"), 0o755);
|
||||||
|
// #2685: this case is a real (non-dry-run) --code-only child, so it hits
|
||||||
|
// detectAutopilot's PATH-resolved `pgrep -f "gbrain autopilot"`. A live
|
||||||
|
// host autopilot is a correct #1734 refuse — the test cannot inject
|
||||||
|
// processRunning. Stub pgrep to "no match" so the pin is about the
|
||||||
|
// symlink, not the operator's daemon. Do not add a production env hatch.
|
||||||
|
writeFileSync(join(bindir, "pgrep"), "#!/bin/sh\nexit 1\n");
|
||||||
|
chmodSync(join(bindir, "pgrep"), 0o755);
|
||||||
|
|
||||||
const r = spawnSync("bun", [SCRIPT, "--code-only", "--quiet"], {
|
const r = spawnSync("bun", [SCRIPT, "--code-only", "--quiet"], {
|
||||||
encoding: "utf-8",
|
encoding: "utf-8",
|
||||||
|
|||||||
Reference in New Issue
Block a user