fix(docker): verify matrix-sdk-crypto native addon without hardcoded pnpm path (#65608) (#67143)

Merged via squash.

Prepared head SHA: 325e97ead5
Co-authored-by: ly85206559 <12526624+ly85206559@users.noreply.github.com>
Co-authored-by: gumadeiras <5599352+gumadeiras@users.noreply.github.com>
Reviewed-by: @gumadeiras
This commit is contained in:
ly85206559
2026-04-15 23:37:14 +08:00
committed by GitHub
parent 8f4331e3b4
commit 3e60eaa884
3 changed files with 17 additions and 0 deletions

View File

@@ -42,6 +42,15 @@ describe("Dockerfile", () => {
expect(dockerfile).toContain("apt-get install -y --no-install-recommends xvfb");
});
it("verifies matrix-sdk-crypto native addons without hardcoded pnpm virtual-store paths", async () => {
const dockerfile = await readFile(dockerfilePath, "utf8");
expect(dockerfile).toContain("Verifying critical native addons");
expect(dockerfile).toContain('find /app/node_modules -name "matrix-sdk-crypto*.node"');
expect(dockerfile).not.toMatch(
/ADDON_DIR=.*node_modules\/\.pnpm\/@matrix-org\+matrix-sdk-crypto-nodejs@/,
);
});
it("prunes runtime dependencies after the build stage", async () => {
const dockerfile = await readFile(dockerfilePath, "utf8");
expect(dockerfile).toContain("FROM build AS runtime-assets");