mirror of
https://github.com/openclaw/openclaw.git
synced 2026-04-12 09:41:11 +00:00
test: harden docker env guard
This commit is contained in:
@@ -7,6 +7,10 @@ import { BUNDLED_PLUGIN_ROOT_DIR } from "../test/helpers/bundled-plugin-paths.js
|
||||
const repoRoot = resolve(fileURLToPath(new URL(".", import.meta.url)), "..");
|
||||
const dockerfilePath = join(repoRoot, "Dockerfile");
|
||||
|
||||
function collapseDockerContinuations(dockerfile: string): string {
|
||||
return dockerfile.replace(/\\\r?\n[ \t]*/g, " ");
|
||||
}
|
||||
|
||||
describe("Dockerfile", () => {
|
||||
it("uses shared multi-arch base image refs for all root Node stages", async () => {
|
||||
const dockerfile = await readFile(dockerfilePath, "utf8");
|
||||
@@ -51,9 +55,9 @@ describe("Dockerfile", () => {
|
||||
});
|
||||
|
||||
it("does not override bundled plugin discovery in runtime images", async () => {
|
||||
const dockerfile = await readFile(dockerfilePath, "utf8");
|
||||
const dockerfile = collapseDockerContinuations(await readFile(dockerfilePath, "utf8"));
|
||||
expect(dockerfile).toContain(`ARG OPENCLAW_BUNDLED_PLUGIN_DIR=${BUNDLED_PLUGIN_ROOT_DIR}`);
|
||||
expect(dockerfile).not.toContain("ENV OPENCLAW_BUNDLED_PLUGINS_DIR=");
|
||||
expect(dockerfile).not.toMatch(/^\s*ENV\b[^\n]*\bOPENCLAW_BUNDLED_PLUGINS_DIR\b/m);
|
||||
});
|
||||
|
||||
it("normalizes plugin and agent paths permissions in image layers", async () => {
|
||||
|
||||
Reference in New Issue
Block a user