Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions tests/ConfigApp.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import * as auth from "@/lib/auth.js";
import * as backend from "@/lib/backend.js";
import * as codegraph from "@/lib/codegraph.js";
import * as configure from "@/lib/configure.js";
import * as shims from "@/lib/shims.js";

// ConfigApp shares its state machine with InstallApp (both render <SetupApp />).
// These tests cover only the config-specific deltas:
Expand Down Expand Up @@ -81,6 +82,17 @@ beforeEach(() => {
created: true,
},
]);
// The finalize Phase calls installShims(), and on Windows that shells out to
// a real `powershell -Command` (execFileSync — NOT the mocked execFile) to
// rewrite the user-scope PATH in the registry: a synchronous spawn that
// blocks the event loop long enough to starve waitForFrame, and that mutates
// the PATH of whatever machine runs the suite. See InstallApp.test.tsx.
vi.spyOn(shims, "installShims").mockReturnValue({
shimDir: join(configAppTempHome, ".codev-hub", "bin"),
shimsWritten: [],
rcFilesUpdated: [],
windowsUserPathUpdated: false,
});
});

type ExecCb = (error: Error | null, stdout: string, stderr: string) => void;
Expand Down
15 changes: 15 additions & 0 deletions tests/InstallApp.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import * as codegraph from "@/lib/codegraph.js";
import * as configure from "@/lib/configure.js";
import { FALLBACK_MODEL } from "@/lib/const.js";
import * as npm from "@/lib/npm.js";
import * as shims from "@/lib/shims.js";
import {
vscodeSettingsPath,
vscodeUserDataDir,
Expand Down Expand Up @@ -97,6 +98,20 @@ beforeEach(() => {
created: true,
},
]);
// The finalize Phase calls installShims(), and on Windows that shells out to
// a real `powershell -Command` (execFileSync — NOT the mocked execFile) to
// rewrite the user-scope PATH in the registry. That's a synchronous spawn
// which blocks the event loop for ~10s on its cold start, so the first flow
// to reach finalize blows past waitForFrame's budget and never renders the
// done screen — and it mutates the PATH of whatever machine runs the suite.
// lib/shims.test.ts skips its installShims block on Windows for the same
// reason; nothing here asserts shim files, so stub the whole call.
vi.spyOn(shims, "installShims").mockReturnValue({
shimDir: join(installAppTempHome, ".codev-hub", "bin"),
shimsWritten: [],
rcFilesUpdated: [],
windowsUserPathUpdated: false,
});
});

type ExecCb = (error: Error | null, stdout: string, stderr: string) => void;
Expand Down
Loading