diff --git a/scripts/check-plugin-gateway-gauntlet.mjs b/scripts/check-plugin-gateway-gauntlet.mjs index 5598ae3c976..930a86942ee 100644 --- a/scripts/check-plugin-gateway-gauntlet.mjs +++ b/scripts/check-plugin-gateway-gauntlet.mjs @@ -15,7 +15,6 @@ import { discoverBundledPluginManifests, selectPluginEntries, } from "./lib/plugin-gateway-gauntlet.mjs"; -import { createPnpmRunnerSpawnSpec } from "./pnpm-runner.mjs"; const DEFAULT_QA_SCENARIOS = [ "channel-chat-baseline", @@ -238,13 +237,11 @@ function parsePositiveNumber(raw, label) { return value; } -function pnpmCommand(args, { cwd, env }) { - return createPnpmRunnerSpawnSpec({ - cwd, - env, - pnpmArgs: args, - stdio: "pipe", - }); +export function createGauntletPrebuildCommand(repoRoot) { + return { + command: process.execPath, + args: [path.join(repoRoot, "scripts", "build-all.mjs"), "cliStartup"], + }; } function openclawCommand(repoRoot, args) { @@ -565,7 +562,7 @@ async function main() { if (!options.skipPrebuild && (selectedPlugins.length > 0 || !options.skipQa)) { process.stderr.write("[plugin-gauntlet] prebuild\n"); const prebuildEnv = buildGauntletPrebuildEnv(env, { includePrivateQa: !options.skipQa }); - const prebuildCommand = pnpmCommand(["build"], { cwd: repoRoot, env: prebuildEnv }); + const prebuildCommand = createGauntletPrebuildCommand(repoRoot); rows.push( runMeasuredCommand({ cwd: repoRoot, @@ -573,7 +570,6 @@ async function main() { logDir: path.join(options.outputDir, "logs", "prebuild"), command: prebuildCommand.command, args: prebuildCommand.args, - spawnOptions: prebuildCommand.options, label: "prebuild", phase: "prebuild", timeoutMs: options.buildTimeoutMs, diff --git a/test/scripts/plugin-gateway-gauntlet.test.ts b/test/scripts/plugin-gateway-gauntlet.test.ts index a17169e4fc7..59171eb3083 100644 --- a/test/scripts/plugin-gateway-gauntlet.test.ts +++ b/test/scripts/plugin-gateway-gauntlet.test.ts @@ -4,6 +4,7 @@ import os from "node:os"; import path from "node:path"; import { afterEach, beforeEach, describe, expect, it } from "vitest"; import { + createGauntletPrebuildCommand, parseTimedMetrics, runMeasuredCommand, } from "../../scripts/check-plugin-gateway-gauntlet.mjs"; @@ -267,6 +268,13 @@ describe("plugin gateway gauntlet helpers", () => { expect(buildGauntletPrebuildEnv(env, { includePrivateQa: false })).toBe(env); }); + it("prebuilds only the CLI startup runtime needed by the gauntlet", () => { + expect(createGauntletPrebuildCommand(repoRoot)).toEqual({ + command: process.execPath, + args: [path.join(repoRoot, "scripts", "build-all.mjs"), "cliStartup"], + }); + }); + it("parses macOS time -l metrics from strict trailing lines", () => { const metrics = parseTimedMetrics( [