Skip to content

Commit 423f7d2

Browse files
committed
fix(test): narrow plugin gauntlet prebuild
1 parent 5b6d409 commit 423f7d2

2 files changed

Lines changed: 14 additions & 10 deletions

File tree

scripts/check-plugin-gateway-gauntlet.mjs

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ import {
1515
discoverBundledPluginManifests,
1616
selectPluginEntries,
1717
} from "./lib/plugin-gateway-gauntlet.mjs";
18-
import { createPnpmRunnerSpawnSpec } from "./pnpm-runner.mjs";
1918

2019
const DEFAULT_QA_SCENARIOS = [
2120
"channel-chat-baseline",
@@ -238,13 +237,11 @@ function parsePositiveNumber(raw, label) {
238237
return value;
239238
}
240239

241-
function pnpmCommand(args, { cwd, env }) {
242-
return createPnpmRunnerSpawnSpec({
243-
cwd,
244-
env,
245-
pnpmArgs: args,
246-
stdio: "pipe",
247-
});
240+
export function createGauntletPrebuildCommand(repoRoot) {
241+
return {
242+
command: process.execPath,
243+
args: [path.join(repoRoot, "scripts", "build-all.mjs"), "cliStartup"],
244+
};
248245
}
249246

250247
function openclawCommand(repoRoot, args) {
@@ -565,15 +562,14 @@ async function main() {
565562
if (!options.skipPrebuild && (selectedPlugins.length > 0 || !options.skipQa)) {
566563
process.stderr.write("[plugin-gauntlet] prebuild\n");
567564
const prebuildEnv = buildGauntletPrebuildEnv(env, { includePrivateQa: !options.skipQa });
568-
const prebuildCommand = pnpmCommand(["build"], { cwd: repoRoot, env: prebuildEnv });
565+
const prebuildCommand = createGauntletPrebuildCommand(repoRoot);
569566
rows.push(
570567
runMeasuredCommand({
571568
cwd: repoRoot,
572569
env: prebuildEnv,
573570
logDir: path.join(options.outputDir, "logs", "prebuild"),
574571
command: prebuildCommand.command,
575572
args: prebuildCommand.args,
576-
spawnOptions: prebuildCommand.options,
577573
label: "prebuild",
578574
phase: "prebuild",
579575
timeoutMs: options.buildTimeoutMs,

test/scripts/plugin-gateway-gauntlet.test.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import os from "node:os";
44
import path from "node:path";
55
import { afterEach, beforeEach, describe, expect, it } from "vitest";
66
import {
7+
createGauntletPrebuildCommand,
78
parseTimedMetrics,
89
runMeasuredCommand,
910
} from "../../scripts/check-plugin-gateway-gauntlet.mjs";
@@ -267,6 +268,13 @@ describe("plugin gateway gauntlet helpers", () => {
267268
expect(buildGauntletPrebuildEnv(env, { includePrivateQa: false })).toBe(env);
268269
});
269270

271+
it("prebuilds only the CLI startup runtime needed by the gauntlet", () => {
272+
expect(createGauntletPrebuildCommand(repoRoot)).toEqual({
273+
command: process.execPath,
274+
args: [path.join(repoRoot, "scripts", "build-all.mjs"), "cliStartup"],
275+
});
276+
});
277+
270278
it("parses macOS time -l metrics from strict trailing lines", () => {
271279
const metrics = parseTimedMetrics(
272280
[

0 commit comments

Comments
 (0)