mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-28 01:52:58 +00:00
fix(test): narrow plugin gauntlet prebuild
This commit is contained in:
@@ -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,
|
||||
|
||||
@@ -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(
|
||||
[
|
||||
|
||||
Reference in New Issue
Block a user