test: first-Linux-run environment fixes — bun-only PATH shim, claude gate, darwin-scoped pdf gates

Three environmental assumptions the Linux lane exposed:
(1) gbrain-detect's deterministic SAFE_PATH lacked the bun runtime, so
every env-shebang spawn exited 127 on CI; a scratch dir holding ONLY a
bun symlink joins the PATH (appending bun's real dir would leak its
siblings — dev boxes keep gbrain there too).
(2) host-config's 'detect finds claude' assumed a claude binary; the
secretless lane deliberately has none — gated on Bun.which.
(3) The four make-pdf render gates hard-required prerequisites on ANY
CI, but the make-pdf gate workflow is macOS-only by decision and the
Linux lane doesn't build dist/pdf — hard-require scoped to darwin.
This commit is contained in:
Garry Tan
2026-08-15 17:40:55 -07:00
parent dedcd3f4f0
commit 7508c92e3a
6 changed files with 29 additions and 6 deletions
+3 -1
View File
@@ -401,7 +401,9 @@ describe('host-config-export.ts CLI', () => {
expect(exitCode).toBe(1);
});
test('detect finds claude (since we are running in claude)', () => {
// Gated: the secretless free-tests CI lane deliberately installs no claude
// CLI, so "we are running in claude" is false there by design.
test.skipIf(!Bun.which('claude'))('detect finds claude (since we are running in claude)', () => {
const { stdout, exitCode } = run('detect');
expect(exitCode).toBe(0);
// claude binary should be on PATH in this environment