From da196f766aa8d12960d2d949058b433879f21cce Mon Sep 17 00:00:00 2001 From: Charan Jagwani Date: Sat, 25 Jul 2026 18:34:39 -0700 Subject: [PATCH 1/3] test(platform): isolate gateway fixtures on macOS Signed-off-by: Charan Jagwani --- src/lib/onboard/gateway-host-runtime.test.ts | 6 +++++- test/e2e/docs/README.md | 6 +++--- test/onboard-exit-handler.test.ts | 5 +++++ 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/src/lib/onboard/gateway-host-runtime.test.ts b/src/lib/onboard/gateway-host-runtime.test.ts index c7b268fc1ac..5d4fbde19b6 100644 --- a/src/lib/onboard/gateway-host-runtime.test.ts +++ b/src/lib/onboard/gateway-host-runtime.test.ts @@ -1,7 +1,7 @@ // SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. // SPDX-License-Identifier: Apache-2.0 -import { afterEach, describe, expect, it, vi } from "vitest"; +import { afterEach, beforeEach, describe, expect, it, vi } from "vitest"; import { createGatewayHostRuntime, type GatewayHostRuntimeDeps } from "./gateway-host-runtime"; import { GATEWAY_MANAGEMENT_ENV_VAR } from "./gateway-management"; @@ -29,6 +29,10 @@ const DECLARATION = { const ORIGINAL_ENV = { ...process.env }; +beforeEach(() => { + vi.spyOn(process, "platform", "get").mockReturnValue("linux"); +}); + afterEach(() => { process.env = { ...ORIGINAL_ENV }; vi.restoreAllMocks(); diff --git a/test/e2e/docs/README.md b/test/e2e/docs/README.md index dddbc5ad0f6..9e9f9489246 100644 --- a/test/e2e/docs/README.md +++ b/test/e2e/docs/README.md @@ -284,9 +284,9 @@ test/e2e/ reporting and scorecards. The workflow boundary requires every selected job shard to upload its evidence artifact. - `.github/workflows/platform-vitest-main.yaml` runs the full Vitest suite in - four independent shards on each of macOS and WSL. Each macOS shard has a - 30-minute budget, each WSL shard has a 90-minute budget, and WSL runs its - additional root-required contracts on shard 1 only. + four independent shards on each of macOS and WSL, with `fail-fast` disabled. + Each macOS shard has a 30-minute budget, each WSL shard has a 90-minute + budget, and WSL runs its additional root-required contracts on shard 1 only. `.github/workflows/e2e-branch-validation.yaml`, `macos-e2e.yaml`, `wsl-e2e.yaml`, and `regression-e2e.yaml` call focused E2E targets directly for their E2E coverage. Individual repository-hosted targets, including diff --git a/test/onboard-exit-handler.test.ts b/test/onboard-exit-handler.test.ts index 0a0478664d4..ac83d41faa3 100644 --- a/test/onboard-exit-handler.test.ts +++ b/test/onboard-exit-handler.test.ts @@ -21,6 +21,9 @@ type OnboardModule = typeof import("../src/lib/onboard") & { const require = createRequire(import.meta.url); const onboard = require("../src/lib/onboard.js") as OnboardModule; const onboardSession = onboard.onboardSession; +const ONBOARD_FIXTURE_PATH = [path.dirname(process.execPath), "/usr/bin", "/bin"].join( + path.delimiter, +); const originalHome = process.env.HOME; const restoreOriginalHome = originalHome === undefined @@ -175,6 +178,7 @@ const { onboard } = require(${onboardPath}); env: { ...process.env, HOME: tmpDir, + PATH: ONBOARD_FIXTURE_PATH, TMPDIR: tmpDir, NEMOCLAW_TEST_NO_SLEEP: "1", }, @@ -330,6 +334,7 @@ const { onboard } = require(${onboardPath}); env: { ...process.env, HOME: tmpDir, + PATH: ONBOARD_FIXTURE_PATH, TMPDIR: tmpDir, NEMOCLAW_TEST_NO_SLEEP: "1", NEMOCLAW_OPENSHELL_BIN: openshellPath, From a323117da95e4dcd36138fd0a723cb03c22c5e8b Mon Sep 17 00:00:00 2001 From: Charan Jagwani Date: Sat, 25 Jul 2026 18:45:36 -0700 Subject: [PATCH 2/3] fix(platform): provision pinned OpenShell on macOS Signed-off-by: Charan Jagwani --- .github/workflows/platform-vitest-main.yaml | 5 +++++ test/e2e/docs/README.md | 5 +++-- test/platform-vitest-main-workflow.test.ts | 10 ++++++++++ 3 files changed, 18 insertions(+), 2 deletions(-) diff --git a/.github/workflows/platform-vitest-main.yaml b/.github/workflows/platform-vitest-main.yaml index 79ffb5d479b..0eecd0c8b07 100644 --- a/.github/workflows/platform-vitest-main.yaml +++ b/.github/workflows/platform-vitest-main.yaml @@ -134,6 +134,11 @@ jobs: stat --version | head -n 1 awk --version | head -n 1 + - name: Install pinned OpenShell + env: + NEMOCLAW_NON_INTERACTIVE: "1" + run: env -u GH_TOKEN -u GITHUB_TOKEN bash scripts/install-openshell.sh + - name: Install dependencies run: | npm ci --ignore-scripts diff --git a/test/e2e/docs/README.md b/test/e2e/docs/README.md index 9e9f9489246..dcd631b0bcf 100644 --- a/test/e2e/docs/README.md +++ b/test/e2e/docs/README.md @@ -285,8 +285,9 @@ test/e2e/ shard to upload its evidence artifact. - `.github/workflows/platform-vitest-main.yaml` runs the full Vitest suite in four independent shards on each of macOS and WSL, with `fail-fast` disabled. - Each macOS shard has a 30-minute budget, each WSL shard has a 90-minute - budget, and WSL runs its additional root-required contracts on shard 1 only. + Each macOS shard installs the pinned OpenShell formula and has a 30-minute + budget. Each WSL shard has a 90-minute budget, and WSL runs its additional + root-required contracts on shard 1 only. `.github/workflows/e2e-branch-validation.yaml`, `macos-e2e.yaml`, `wsl-e2e.yaml`, and `regression-e2e.yaml` call focused E2E targets directly for their E2E coverage. Individual repository-hosted targets, including diff --git a/test/platform-vitest-main-workflow.test.ts b/test/platform-vitest-main-workflow.test.ts index db0550e8572..721e8f234ea 100644 --- a/test/platform-vitest-main-workflow.test.ts +++ b/test/platform-vitest-main-workflow.test.ts @@ -34,6 +34,7 @@ describe("platform Vitest main workflow", () => { const checkout = step("macos-vitest", "Checkout"); const setupPython = step("macos-vitest", "Setup Python"); const install = step("macos-vitest", "Install macOS test dependencies"); + const installOpenShell = step("macos-vitest", "Install pinned OpenShell"); const run = install.run ?? ""; expect(job("macos-vitest")["timeout-minutes"]).toBe(30); @@ -49,6 +50,9 @@ describe("platform Vitest main workflow", () => { stepNames.indexOf("Install macOS test dependencies"), ); expect(stepNames.indexOf("Install macOS test dependencies")).toBeLessThan( + stepNames.indexOf("Install pinned OpenShell"), + ); + expect(stepNames.indexOf("Install pinned OpenShell")).toBeLessThan( stepNames.indexOf("Run full Vitest suite on macOS"), ); expect(setupPython.uses).toBe("actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97"); @@ -66,6 +70,12 @@ describe("platform Vitest main workflow", () => { expect(run).toContain("--only-binary=:all:"); expect(run).toContain("--require-hashes"); expect(run).toContain(`--requirement ${MACOS_REQUIREMENTS_PATH}`); + expect(installOpenShell.env).toMatchObject({ + NEMOCLAW_NON_INTERACTIVE: "1", + }); + expect(installOpenShell.run).toBe( + "env -u GH_TOKEN -u GITHUB_TOKEN bash scripts/install-openshell.sh", + ); expect(step("macos-vitest", "Run full Vitest suite on macOS").run).toContain( '--shard="${{ matrix.shard }}/4"', ); From dd69a845d8ed7e1c1ff5d453a334d48ee93b6788 Mon Sep 17 00:00:00 2001 From: Charan Jagwani Date: Sat, 25 Jul 2026 18:51:00 -0700 Subject: [PATCH 3/3] test(onboard): exclude Homebrew from fixture PATH Signed-off-by: Charan Jagwani --- test/onboard-exit-handler.test.ts | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/test/onboard-exit-handler.test.ts b/test/onboard-exit-handler.test.ts index ac83d41faa3..c067f33edb7 100644 --- a/test/onboard-exit-handler.test.ts +++ b/test/onboard-exit-handler.test.ts @@ -21,9 +21,7 @@ type OnboardModule = typeof import("../src/lib/onboard") & { const require = createRequire(import.meta.url); const onboard = require("../src/lib/onboard.js") as OnboardModule; const onboardSession = onboard.onboardSession; -const ONBOARD_FIXTURE_PATH = [path.dirname(process.execPath), "/usr/bin", "/bin"].join( - path.delimiter, -); +const ONBOARD_FIXTURE_PATH = ["/usr/bin", "/bin"].join(path.delimiter); const originalHome = process.env.HOME; const restoreOriginalHome = originalHome === undefined