diff --git a/src/dockerfile.test.ts b/src/dockerfile.test.ts index 29f3faa31ac..1384942866c 100644 --- a/src/dockerfile.test.ts +++ b/src/dockerfile.test.ts @@ -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 () => {