ci(docker): preserve pnpm path in scheduler lanes · openclaw/openclaw@43e651d
steipete
·
2026-04-27
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -142,10 +142,20 @@ function appendExtension(env, extension) {
|
142 | 142 | } |
143 | 143 | |
144 | 144 | function commandEnv(extra = {}) { |
145 | | -return { |
| 145 | +const env = { |
146 | 146 | ...process.env, |
147 | 147 | ...extra, |
148 | 148 | }; |
| 149 | +const pathEntries = [ |
| 150 | +env.PATH, |
| 151 | +env.PNPM_HOME, |
| 152 | +env.npm_execpath ? path.dirname(env.npm_execpath) : undefined, |
| 153 | +path.dirname(process.execPath), |
| 154 | +] |
| 155 | +.flatMap((entry) => (entry ? String(entry).split(path.delimiter) : [])) |
| 156 | +.filter(Boolean); |
| 157 | +env.PATH = [...new Set(pathEntries)].join(path.delimiter); |
| 158 | +return env; |
149 | 159 | } |
150 | 160 | |
151 | 161 | function shellQuote(value) { |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -2,6 +2,7 @@ import { readFileSync } from "node:fs";
|
2 | 2 | import { describe, expect, it } from "vitest"; |
3 | 3 | |
4 | 4 | const HELPER_PATH = "scripts/lib/docker-build.sh"; |
| 5 | +const DOCKER_ALL_SCHEDULER_PATH = "scripts/test-docker-all.mjs"; |
5 | 6 | const CENTRALIZED_BUILD_SCRIPTS = [ |
6 | 7 | "scripts/docker/setup.sh", |
7 | 8 | "scripts/e2e/browser-cdp-snapshot-docker.sh", |
@@ -35,4 +36,13 @@ describe("docker build helper", () => {
|
35 | 36 | expect(script, path).not.toMatch(/run_logged\s+\S+\s+docker\s+build/); |
36 | 37 | } |
37 | 38 | }); |
| 39 | + |
| 40 | +it("preserves pnpm lookup paths for scheduled Docker child lanes", () => { |
| 41 | +const scheduler = readFileSync(DOCKER_ALL_SCHEDULER_PATH, "utf8"); |
| 42 | + |
| 43 | +expect(scheduler).toContain("env.PNPM_HOME"); |
| 44 | +expect(scheduler).toContain("env.npm_execpath ? path.dirname(env.npm_execpath)"); |
| 45 | +expect(scheduler).toContain("path.dirname(process.execPath)"); |
| 46 | +expect(scheduler).toContain("env.PATH = [...new Set(pathEntries)].join(path.delimiter)"); |
| 47 | +}); |
38 | 48 | }); |
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。