Docker: narrow e2e install inputs

This commit is contained in:
Vincent Koc 2026-03-08 16:59:22 -07:00
parent 7757f6ff71
commit 5fab5c6284
2 changed files with 10 additions and 1 deletions

View File

@ -8,7 +8,7 @@ WORKDIR /app
ENV NODE_OPTIONS="--disable-warning=ExperimentalWarning"
COPY package.json pnpm-lock.yaml pnpm-workspace.yaml tsconfig.json tsconfig.plugin-sdk.dts.json tsdown.config.ts vitest.config.ts vitest.e2e.config.ts openclaw.mjs ./
COPY package.json pnpm-lock.yaml pnpm-workspace.yaml ./
COPY ui/package.json ./ui/package.json
COPY extensions/memory-core/package.json ./extensions/memory-core/package.json
COPY patches ./patches
@ -16,6 +16,7 @@ COPY patches ./patches
RUN --mount=type=cache,id=openclaw-pnpm-store,target=/root/.local/share/pnpm/store,sharing=locked \
pnpm install --frozen-lockfile
COPY tsconfig.json tsconfig.plugin-sdk.dts.json tsdown.config.ts vitest.config.ts vitest.e2e.config.ts openclaw.mjs ./
COPY src ./src
COPY test ./test
COPY scripts ./scripts

View File

@ -86,12 +86,20 @@ describe("docker build cache layout", () => {
const dockerfile = await readRepoFile("scripts/e2e/Dockerfile");
const installIndex = dockerfile.indexOf("pnpm install --frozen-lockfile");
expect(
dockerfile.indexOf("COPY package.json pnpm-lock.yaml pnpm-workspace.yaml ./"),
).toBeLessThan(installIndex);
expect(dockerfile.indexOf("COPY ui/package.json ./ui/package.json")).toBeLessThan(installIndex);
expect(
dockerfile.indexOf(
"COPY extensions/memory-core/package.json ./extensions/memory-core/package.json",
),
).toBeLessThan(installIndex);
expect(
dockerfile.indexOf(
"COPY tsconfig.json tsconfig.plugin-sdk.dts.json tsdown.config.ts vitest.config.ts vitest.e2e.config.ts openclaw.mjs ./",
),
).toBeGreaterThan(installIndex);
expect(dockerfile.indexOf("COPY src ./src")).toBeGreaterThan(installIndex);
expect(dockerfile.indexOf("COPY test ./test")).toBeGreaterThan(installIndex);
expect(dockerfile.indexOf("COPY scripts ./scripts")).toBeGreaterThan(installIndex);