From 61a539a1b7bd4f027df86a54ffaa2893c1700c9d Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Sun, 26 Apr 2026 22:54:17 +0100 Subject: [PATCH] ci(docker): use resolved pnpm for scheduled lanes --- .../openclaw-live-and-e2e-checks-reusable.yml | 2 ++ scripts/test-docker-all.mjs | 14 +++++++++++++- test/scripts/docker-build-helper.test.ts | 2 ++ 3 files changed, 17 insertions(+), 1 deletion(-) diff --git a/.github/workflows/openclaw-live-and-e2e-checks-reusable.yml b/.github/workflows/openclaw-live-and-e2e-checks-reusable.yml index 682eae3c66d..7e486cda44e 100644 --- a/.github/workflows/openclaw-live-and-e2e-checks-reusable.yml +++ b/.github/workflows/openclaw-live-and-e2e-checks-reusable.yml @@ -513,6 +513,7 @@ jobs: export OPENCLAW_DOCKER_ALL_INCLUDE_OPENWEBUI="${INCLUDE_OPENWEBUI}" export OPENCLAW_DOCKER_ALL_LOG_DIR=".artifacts/docker-tests/release-${DOCKER_E2E_CHUNK}" export OPENCLAW_DOCKER_ALL_TIMINGS_FILE=".artifacts/docker-tests/release-${DOCKER_E2E_CHUNK}-timings.json" + export OPENCLAW_DOCKER_ALL_PNPM_COMMAND="$(command -v pnpm)" pnpm test:docker:all @@ -669,6 +670,7 @@ jobs: export OPENCLAW_DOCKER_ALL_INCLUDE_OPENWEBUI="${INCLUDE_OPENWEBUI}" export OPENCLAW_DOCKER_ALL_LOG_DIR=".artifacts/docker-tests/targeted" export OPENCLAW_DOCKER_ALL_TIMINGS_FILE=".artifacts/docker-tests/targeted-timings.json" + export OPENCLAW_DOCKER_ALL_PNPM_COMMAND="$(command -v pnpm)" if [[ "$lanes" == *" live-"* ]]; then export OPENCLAW_DOCKER_ALL_BUILD=1 else diff --git a/scripts/test-docker-all.mjs b/scripts/test-docker-all.mjs index a847c7baa6f..b4f6a7f983c 100644 --- a/scripts/test-docker-all.mjs +++ b/scripts/test-docker-all.mjs @@ -663,9 +663,20 @@ function buildLaneRerunCommand(name, baseEnv) { ["OPENCLAW_SKIP_DOCKER_BUILD", "1"], ["OPENCLAW_DOCKER_E2E_IMAGE", baseEnv.OPENCLAW_DOCKER_E2E_IMAGE || DEFAULT_E2E_IMAGE], ]; + if (baseEnv.OPENCLAW_DOCKER_ALL_PNPM_COMMAND) { + env.push(["OPENCLAW_DOCKER_ALL_PNPM_COMMAND", baseEnv.OPENCLAW_DOCKER_ALL_PNPM_COMMAND]); + } return `${env.map(([key, value]) => `${key}=${shellQuote(value)}`).join(" ")} pnpm test:docker:all`; } +function withResolvedPnpmCommand(command, env) { + const pnpmCommand = env.OPENCLAW_DOCKER_ALL_PNPM_COMMAND?.trim(); + if (!pnpmCommand) { + return command; + } + return command.replace(/(^|\s)pnpm(?=\s)/g, `$1${shellQuote(pnpmCommand)}`); +} + function timingSeconds(timingStore, poolLane) { const fromStore = timingStore?.lanes?.[poolLane.name]?.durationSeconds; if (typeof fromStore === "number" && Number.isFinite(fromStore) && fromStore > 0) { @@ -1003,10 +1014,11 @@ function laneEnv(name, baseEnv, logDir, cacheKey) { } async function runLane(lane, baseEnv, logDir, fallbackTimeoutMs) { - const { command, name } = lane; + const { name } = lane; const timeoutMs = lane.timeoutMs ?? fallbackTimeoutMs; const logFile = path.join(logDir, `${name}.log`); const env = laneEnv(name, baseEnv, logDir, lane.cacheKey); + const command = withResolvedPnpmCommand(lane.command, env); await mkdir(env.OPENCLAW_DOCKER_CLI_TOOLS_DIR, { recursive: true }); await mkdir(env.OPENCLAW_DOCKER_CACHE_HOME_DIR, { recursive: true }); await fs.promises.writeFile( diff --git a/test/scripts/docker-build-helper.test.ts b/test/scripts/docker-build-helper.test.ts index 28f36e9388b..c7fcb204063 100644 --- a/test/scripts/docker-build-helper.test.ts +++ b/test/scripts/docker-build-helper.test.ts @@ -44,5 +44,7 @@ describe("docker build helper", () => { expect(scheduler).toContain("env.npm_execpath ? path.dirname(env.npm_execpath)"); expect(scheduler).toContain("path.dirname(process.execPath)"); expect(scheduler).toContain("env.PATH = [...new Set(pathEntries)].join(path.delimiter)"); + expect(scheduler).toContain("withResolvedPnpmCommand"); + expect(scheduler).toContain("OPENCLAW_DOCKER_ALL_PNPM_COMMAND"); }); });