it("uses pnpm cache mounts in Dockerfiles that install repo dependencies", async () => { for (const path of [ "Dockerfile", "scripts/e2e/Dockerfile", "scripts/e2e/Dockerfile.qr-import", "scripts/docker/cleanup-smoke/Dockerfile",
]) { const dockerfile = await readRepoFile(path);
expect(
dockerfile,
`${path} should use a shared pnpm store cache under the active user's home`,
).toMatch(
/--mount=type=cache,id=openclaw-pnpm-store,target=\/(?:root|home\/appuser)\/\.local\/share\/pnpm\/store,sharing=locked/,
);
}
});
it("uses apt cache mounts in Dockerfiles that install system packages", async () => { for (const path of [ "Dockerfile", "Dockerfile.sandbox", "Dockerfile.sandbox-browser", "Dockerfile.sandbox-common", "scripts/docker/cleanup-smoke/Dockerfile", "scripts/docker/install-sh-smoke/Dockerfile", "scripts/docker/install-sh-e2e/Dockerfile", "scripts/docker/install-sh-nonroot/Dockerfile",
]) { const dockerfile = await readRepoFile(path);
expect(dockerfile, `${path} should cache apt package archives`).toContain( "target=/var/cache/apt,sharing=locked",
);
expect(dockerfile, `${path} should cache apt metadata`).toContain( "target=/var/lib/apt,sharing=locked",
);
}
});
it("does not leave empty shell continuation lines in sandbox-common", async () => { const dockerfile = await readRepoFile("Dockerfile.sandbox-common");
expect(dockerfile).not.toContain("apt-get install -y --no-install-recommends ${PACKAGES} \\");
expect(dockerfile).toContain( 'RUN if [ "${INSTALL_PNPM}" = "1" ]; then npm install -g pnpm; fi',
);
});
it("does not leave blank lines after shell continuation markers", async () => { for (const path of [ "Dockerfile.sandbox", "Dockerfile.sandbox-browser", "Dockerfile.sandbox-common", "scripts/docker/cleanup-smoke/Dockerfile", "scripts/docker/install-sh-smoke/Dockerfile", "scripts/docker/install-sh-e2e/Dockerfile", "scripts/docker/install-sh-nonroot/Dockerfile",
]) { const dockerfile = await readRepoFile(path);
expect(
dockerfile,
`${path} should not have blank lines after a trailing backslash`,
).not.toMatch(/\\\n\s*\n/);
}
});
it("copies only install inputs before pnpm install in the e2e image", async () => { const dockerfile = await readRepoFile("scripts/e2e/Dockerfile"); const installIndex = dockerfile.indexOf("pnpm install --frozen-lockfile"); const expectPatternBeforeInstall = (pattern: RegExp) => { const index = indexOfPattern(dockerfile, pattern);
expect(index).toBeGreaterThan(-1);
expect(index).toBeLessThan(installIndex);
}; const expectPatternAfterInstall = (pattern: RegExp) => { const index = indexOfPattern(dockerfile, pattern);
expect(index).toBeGreaterThan(installIndex);
};
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.