test: harden docker env guard

This commit is contained in:
Gustavo Madeira Santana
2026-04-07 02:06:26 -04:00
parent 27cea97999
commit c2bbfef188

View File

@@ -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 () => {