





























@@ -197,12 +197,38 @@ function buildLaneRerunCommand(name, baseEnv) {
197197["OPENCLAW_DOCKER_E2E_FUNCTIONAL_IMAGE", baseEnv.OPENCLAW_DOCKER_E2E_FUNCTIONAL_IMAGE],
198198["OPENCLAW_CURRENT_PACKAGE_TGZ", baseEnv.OPENCLAW_CURRENT_PACKAGE_TGZ],
199199];
200+if (baseEnv.OPENCLAW_DOCKER_ALL_PNPM_COMMAND) {
201+env.push(["OPENCLAW_DOCKER_ALL_PNPM_COMMAND", baseEnv.OPENCLAW_DOCKER_ALL_PNPM_COMMAND]);
202+}
200203return `${env
201204 .filter(([, value]) => value !== undefined && value !== "")
202205 .map(([key, value]) => `${key}=${shellQuote(value)}`)
203206 .join(" ")} pnpm test:docker:all`;
204207}
205208209+function withResolvedPnpmCommand(command, env) {
210+const pnpmCommand = env.OPENCLAW_DOCKER_ALL_PNPM_COMMAND?.trim();
211+if (!pnpmCommand) {
212+return command;
213+}
214+return command.replace(/(^|\s)pnpm(?=\s)/g, `$1${shellQuote(pnpmCommand)}`);
215+}
216+217+function timingSeconds(timingStore, poolLane) {
218+const fromStore = timingStore?.lanes?.[poolLane.name]?.durationSeconds;
219+if (typeof fromStore === "number" && Number.isFinite(fromStore) && fromStore > 0) {
220+return fromStore;
221+}
222+return poolLane.estimateSeconds ?? 0;
223+}
224+225+function orderLanes(poolLanes, timingStore) {
226+return poolLanes
227+.map((poolLane, index) => ({ index, poolLane, seconds: timingSeconds(timingStore, poolLane) }))
228+.toSorted((a, b) => b.seconds - a.seconds || a.index - b.index)
229+.map(({ poolLane }) => poolLane);
230+}
231+206232async function loadTimingStore(file, enabled) {
207233if (!enabled) {
208234return { enabled: false, file, lanes: {}, version: 1 };
@@ -611,10 +637,11 @@ function laneEnv(poolLane, baseEnv, logDir, cacheKey) {
611637}
612638613639async function runLane(lane, baseEnv, logDir, fallbackTimeoutMs) {
614-const { command, name } = lane;
640+const { name } = lane;
615641const timeoutMs = lane.timeoutMs ?? fallbackTimeoutMs;
616642const logFile = path.join(logDir, `${name}.log`);
617643const env = laneEnv(lane, baseEnv, logDir, lane.cacheKey);
644+const command = withResolvedPnpmCommand(lane.command, env);
618645await mkdir(env.OPENCLAW_DOCKER_CLI_TOOLS_DIR, { recursive: true });
619646await mkdir(env.OPENCLAW_DOCKER_CACHE_HOME_DIR, { recursive: true });
620647await fs.promises.writeFile(
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。