mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 09:20:43 +00:00
ci(docker): preserve pnpm path in scheduler lanes
(cherry picked from commit 2e8a089836)
This commit is contained in:
@@ -142,10 +142,20 @@ function appendExtension(env, extension) {
|
||||
}
|
||||
|
||||
function commandEnv(extra = {}) {
|
||||
return {
|
||||
const env = {
|
||||
...process.env,
|
||||
...extra,
|
||||
};
|
||||
const pathEntries = [
|
||||
env.PATH,
|
||||
env.PNPM_HOME,
|
||||
env.npm_execpath ? path.dirname(env.npm_execpath) : undefined,
|
||||
path.dirname(process.execPath),
|
||||
]
|
||||
.flatMap((entry) => (entry ? String(entry).split(path.delimiter) : []))
|
||||
.filter(Boolean);
|
||||
env.PATH = [...new Set(pathEntries)].join(path.delimiter);
|
||||
return env;
|
||||
}
|
||||
|
||||
function shellQuote(value) {
|
||||
|
||||
@@ -2,6 +2,7 @@ import { readFileSync } from "node:fs";
|
||||
import { describe, expect, it } from "vitest";
|
||||
|
||||
const HELPER_PATH = "scripts/lib/docker-build.sh";
|
||||
const DOCKER_ALL_SCHEDULER_PATH = "scripts/test-docker-all.mjs";
|
||||
const CENTRALIZED_BUILD_SCRIPTS = [
|
||||
"scripts/docker/setup.sh",
|
||||
"scripts/e2e/browser-cdp-snapshot-docker.sh",
|
||||
@@ -35,4 +36,13 @@ describe("docker build helper", () => {
|
||||
expect(script, path).not.toMatch(/run_logged\s+\S+\s+docker\s+build/);
|
||||
}
|
||||
});
|
||||
|
||||
it("preserves pnpm lookup paths for scheduled Docker child lanes", () => {
|
||||
const scheduler = readFileSync(DOCKER_ALL_SCHEDULER_PATH, "utf8");
|
||||
|
||||
expect(scheduler).toContain("env.PNPM_HOME");
|
||||
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)");
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user