diff --git a/scripts/docker/cleanup-smoke/Dockerfile b/scripts/docker/cleanup-smoke/Dockerfile index b7b37d2ecb8..4a26e9fce85 100644 --- a/scripts/docker/cleanup-smoke/Dockerfile +++ b/scripts/docker/cleanup-smoke/Dockerfile @@ -19,7 +19,7 @@ COPY ui/package.json ./ui/package.json COPY packages ./packages COPY extensions ./extensions COPY patches ./patches -COPY scripts/postinstall-bundled-plugins.mjs scripts/preinstall-package-manager-warning.mjs scripts/npm-runner.mjs scripts/windows-cmd-helpers.mjs ./scripts/ +COPY scripts/postinstall-bundled-plugins.mjs scripts/preinstall-package-manager-warning.mjs scripts/prepare-git-hooks.mjs scripts/npm-runner.mjs scripts/windows-cmd-helpers.mjs ./scripts/ COPY scripts/lib/package-dist-imports.mjs ./scripts/lib/package-dist-imports.mjs RUN --mount=type=cache,id=openclaw-pnpm-store,target=/root/.local/share/pnpm/store,sharing=locked \ corepack enable \ diff --git a/test/scripts/docker-build-helper.test.ts b/test/scripts/docker-build-helper.test.ts index d21c214e61f..d0ced80ac30 100644 --- a/test/scripts/docker-build-helper.test.ts +++ b/test/scripts/docker-build-helper.test.ts @@ -25,6 +25,7 @@ const BUNDLED_PLUGIN_INSTALL_UNINSTALL_PROBE_PATH = "scripts/e2e/lib/bundled-plugin-install-uninstall/probe.mjs"; const BUNDLED_PLUGIN_INSTALL_UNINSTALL_RUNTIME_SMOKE_PATH = "scripts/e2e/lib/bundled-plugin-install-uninstall/runtime-smoke.mjs"; +const CLEANUP_SMOKE_DOCKERFILE_PATH = "scripts/docker/cleanup-smoke/Dockerfile"; const PLUGINS_DOCKER_E2E_PATH = "scripts/e2e/plugins-docker.sh"; const PLUGINS_DOCKER_SWEEP_PATH = "scripts/e2e/lib/plugins/sweep.sh"; const PLUGINS_DOCKER_MARKETPLACE_PATH = "scripts/e2e/lib/plugins/marketplace.sh"; @@ -107,6 +108,22 @@ describe("docker build helper", () => { expect(dockerfile).toContain("procps"); }); + it("copies root lifecycle scripts before cleanup-smoke installs dependencies", () => { + const dockerfile = readFileSync(CLEANUP_SMOKE_DOCKERFILE_PATH, "utf8"); + const installIndex = dockerfile.indexOf("pnpm install --frozen-lockfile"); + + for (const script of [ + "scripts/preinstall-package-manager-warning.mjs", + "scripts/postinstall-bundled-plugins.mjs", + "scripts/prepare-git-hooks.mjs", + ]) { + const copyIndex = dockerfile.indexOf(script); + + expect(copyIndex, script).toBeGreaterThanOrEqual(0); + expect(copyIndex, script).toBeLessThan(installIndex); + } + }); + it("preserves pnpm lookup paths for scheduled Docker child lanes", () => { const scheduler = readFileSync(DOCKER_ALL_SCHEDULER_PATH, "utf8");