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/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..dcd631b0bcf 100644 --- a/test/e2e/docs/README.md +++ b/test/e2e/docs/README.md @@ -284,9 +284,10 @@ 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 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/onboard-exit-handler.test.ts b/test/onboard-exit-handler.test.ts index 0a0478664d4..c067f33edb7 100644 --- a/test/onboard-exit-handler.test.ts +++ b/test/onboard-exit-handler.test.ts @@ -21,6 +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 = ["/usr/bin", "/bin"].join(path.delimiter); const originalHome = process.env.HOME; const restoreOriginalHome = originalHome === undefined @@ -175,6 +176,7 @@ const { onboard } = require(${onboardPath}); env: { ...process.env, HOME: tmpDir, + PATH: ONBOARD_FIXTURE_PATH, TMPDIR: tmpDir, NEMOCLAW_TEST_NO_SLEEP: "1", }, @@ -330,6 +332,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, 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"', );