fix(ci): preserve crabbox hydrate pnpm store

This commit is contained in:
Vincent Koc
2026-06-04 03:59:42 +02:00
parent e1e095d020
commit d26cef4249
3 changed files with 30 additions and 11 deletions

View File

@@ -141,9 +141,19 @@ describe("package acceptance workflow", () => {
expect(hydratePnpm.if).toBeUndefined();
expect(hydratePnpm.run).toContain('corepack enable --install-directory "$PNPM_HOME"');
expect(hydratePnpm.run).toContain("COREPACK_HOME");
expect(hydratePnpm.run).toContain("reset_crabbox_pnpm_root");
expect(hydratePnpm.run).toContain('rm -rf -- "$root"');
expect(hydratePnpm.run).toContain("Refusing unsafe pnpm cache root");
expect(workflowText).toContain('PNPM_CONFIG_STORE_DIR: "/var/cache/crabbox/pnpm/store"');
expect(hydratePnpm.run).toContain("prepare_crabbox_pnpm_dirs");
expect(hydratePnpm.run).toContain('case "${PNPM_CONFIG_MODULES_DIR:?}" in "$volatile_root"/*)');
expect(hydratePnpm.run).toContain(
'case "${PNPM_CONFIG_VIRTUAL_STORE_DIR:?}" in "$volatile_root"/*)',
);
expect(hydratePnpm.run).toContain('rm -rf -- "$volatile_root"');
expect(hydratePnpm.run).toContain('mkdir -p "$volatile_root" "$PNPM_CONFIG_STORE_DIR"');
expect(hydratePnpm.run).toContain(
'mkdir -p "$PNPM_CONFIG_MODULES_DIR" "$PNPM_CONFIG_VIRTUAL_STORE_DIR"',
);
expect(hydratePnpm.run).toContain("Refusing unsafe pnpm directory");
expect(hydratePnpm.run).not.toContain('rm -rf -- "${PNPM_CONFIG_MODULES_DIR:?}"');
expect(hydratePnpm.run).toContain(
'[ "$(readlink node_modules)" = "${PNPM_CONFIG_MODULES_DIR:-}" ]',
);