Skip to content

Commit 08947d3

Browse files
committed
test: fix Windows qualification fixtures
1 parent 8afe3ad commit 08947d3

4 files changed

Lines changed: 48 additions & 29 deletions

File tree

tests/codex-rescue-qualification.test.mjs

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -195,13 +195,14 @@ test('qualifies distinct canonical linked worktree execution while hooks remain
195195
const snapshotStorage = async () => Promise.all(windowsDirectories.map(async (path) => {
196196
const metadata = await stat(path); return { path, entries: (await readdir(path)).sort(), mode: metadata.mode, mtimeMs: metadata.mtimeMs, ctimeMs: metadata.ctimeMs };
197197
}));
198-
const windowsBefore = await snapshotStorage(); const platformDescriptor = Object.getOwnPropertyDescriptor(process, 'platform');
199-
Object.defineProperty(process, 'platform', { ...platformDescriptor, value: 'win32' });
200-
try { await qualifyCodexRescuePreparedContinuationEvidence(windowsInput); } finally { Object.defineProperty(process, 'platform', platformDescriptor); }
198+
const windowsBefore = await snapshotStorage(); const platformBefore = process.platform;
199+
windowsInput.installedStoragePermissionModel = 'windows';
200+
await qualifyCodexRescuePreparedContinuationEvidence(windowsInput);
201+
assert.equal(process.platform, platformBefore);
201202
assert.deepEqual(await snapshotStorage(), windowsBefore);
202-
Object.defineProperty(process, 'platform', { ...platformDescriptor, value: 'linux' });
203-
try { await assert.rejects(qualifyCodexRescuePreparedContinuationEvidence(windowsInput), CodexRescueEvidenceMismatchError); }
204-
finally { Object.defineProperty(process, 'platform', platformDescriptor); }
203+
windowsInput.installedStoragePermissionModel = 'posix';
204+
await assert.rejects(qualifyCodexRescuePreparedContinuationEvidence(windowsInput), CodexRescueEvidenceMismatchError);
205+
assert.equal(process.platform, platformBefore);
205206
assert.deepEqual(await snapshotStorage(), windowsBefore);
206207

207208
const swapped = workspaceBoundContinuationFixture(originWorkspace, executionWorkspace);

0 commit comments

Comments
 (0)