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
+4 -1
View File
@@ -164,7 +164,10 @@ describe("diagram render gate", () => {
if (!avail.ok) {
test("diagram gate prerequisites are present (hard-required in CI)", () => {
if (process.env.CI) {
// Hard-require only where the binary is expected: the make-pdf gate
// workflow is macOS-only (path-filtered) and builds dist/pdf first.
// The Linux free lane deliberately doesn't build it — warn-skip there.
if (process.env.CI && process.platform === 'darwin') {
throw new Error(`diagram gate prerequisites missing in CI: ${avail.reason}`);
}
console.warn(`[skip] ${avail.reason}`);
+4 -1
View File
@@ -188,7 +188,10 @@ describe("emoji render gate", () => {
// In CI, missing prerequisites are a hard failure — a silent skip would let
// the Linux tofu regression ship behind a green build. Locally, just warn.
test("emoji gate prerequisites are present (hard-required in CI)", () => {
if (process.env.CI) {
// Hard-require only where the binary is expected: the make-pdf gate
// workflow is macOS-only (path-filtered) and builds dist/pdf first.
// The Linux free lane deliberately doesn't build it — warn-skip there.
if (process.env.CI && process.platform === 'darwin') {
throw new Error(`emoji gate prerequisites missing in CI: ${avail.reason}`);
}
console.warn(`[skip] ${avail.reason}`);
+4 -1
View File
@@ -122,7 +122,10 @@ describe("output format gate", () => {
if (!avail.ok) {
test("format gate prerequisites are present (hard-required in CI)", () => {
if (process.env.CI) {
// Hard-require only where the binary is expected: the make-pdf gate
// workflow is macOS-only (path-filtered) and builds dist/pdf first.
// The Linux free lane deliberately doesn't build it — warn-skip there.
if (process.env.CI && process.platform === 'darwin') {
throw new Error(`format gate prerequisites missing in CI: ${avail.reason}`);
}
console.warn(`[skip] ${avail.reason}`);
+4 -1
View File
@@ -127,7 +127,10 @@ describe("landscape promotion gate", () => {
if (!avail.ok) {
test("landscape gate prerequisites are present (hard-required in CI)", () => {
if (process.env.CI) {
// Hard-require only where the binary is expected: the make-pdf gate
// workflow is macOS-only (path-filtered) and builds dist/pdf first.
// The Linux free lane deliberately doesn't build it — warn-skip there.
if (process.env.CI && process.platform === 'darwin') {
throw new Error(`landscape gate prerequisites missing in CI: ${avail.reason}`);
}
console.warn(`[skip] ${avail.reason}`);