test(FN-4786): stabilize cli tmp-dir tests for workspace runs
Fusion-Task-Id: FN-4786 Fusion-Task-Lineage: eb683ec8-8b9d-4e3d-852c-7076224afa6b
This commit is contained in:
committed by
gsxdsm
parent
ec169bf347
commit
825e5479f5
@@ -6,10 +6,10 @@ const CLI_PACKAGE_VERSION = (
|
||||
JSON.parse(readFileSync(new URL("../../package.json", import.meta.url), "utf-8")) as { version: string }
|
||||
).version;
|
||||
|
||||
const cacheDir = "/tmp/fusion-update-cache-test";
|
||||
const cacheDir = `/tmp/fusion-update-cache-test-${process.pid}-${Date.now()}`;
|
||||
|
||||
const { mockResolveGlobalDir } = vi.hoisted(() => ({
|
||||
mockResolveGlobalDir: vi.fn().mockReturnValue("/tmp/fusion-update-cache-test"),
|
||||
mockResolveGlobalDir: vi.fn().mockReturnValue(cacheDir),
|
||||
}));
|
||||
|
||||
vi.mock("@fusion/core", () => ({
|
||||
|
||||
@@ -88,7 +88,7 @@ function restoreInternalPackageDistDirs() {
|
||||
|
||||
describe("vitest workspace temp dir cleanup", () => {
|
||||
it("cleans stale workspace-resolution temp dirs without touching unrelated tmp dirs", () => {
|
||||
const staleDir = join(workspaceRoot, `${hiddenDistRootPrefix}stale-test`);
|
||||
const staleDir = join(workspaceRoot, `${hiddenDistRootPrefix}stale-test-${process.pid}-${Date.now()}`);
|
||||
const staleMarker = join(staleDir, "marker.txt");
|
||||
const unrelatedTmpDir = join(workspaceRoot, ".tmp-fn-other-marker-test");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user