fix(e2e): clear restored macOS npm cache

This commit is contained in:
Vincent Koc
2026-06-16 12:41:00 +08:00
parent 99a398a4b1
commit 88c9e4d644
2 changed files with 8 additions and 0 deletions

View File

@@ -797,6 +797,8 @@ printf 'preflight.umask=%s\n' "$(umask)"
printf 'preflight.npmRoot=%s\n' "$(${guestNpm} root -g 2>/dev/null || true)"
${guestNpm} uninstall -g openclaw >/dev/null 2>&1 || true
rm -rf "$HOME/.openclaw"
# Restored snapshots can contain corrupt optional-dependency tarballs that npm silently skips.
rm -rf "$HOME/.npm/_cacache"
rm -f /tmp/openclaw-parallels-macos-gateway.log`);
}

View File

@@ -936,6 +936,12 @@ if (isPrlctl) {
expect(guestTransports.match(/umask 022/g)).toHaveLength(2);
});
it("clears restored macOS npm content cache before install lanes", () => {
const macos = readFileSync(TS_PATHS.macos, "utf8");
expect(macos).toContain('rm -rf "$HOME/.npm/_cacache"');
});
it("provisions portable Git before Windows dev update lanes", () => {
const script = readFileSync(TS_PATHS.windows, "utf8");
const windowsGit = readFileSync(TS_PATHS.windowsGit, "utf8");