From 588f4d948d8ac1c023366dbdc337546cb3ca65d3 Mon Sep 17 00:00:00 2001 From: imccyu <276526105+imccyu@users.noreply.github.com> Date: Sat, 18 Jul 2026 12:10:18 +0800 Subject: [PATCH] test(windows): mark platform-only coverage branches --- packages/context/workspace-context/src/files.ts | 1 + packages/context/workspace-context/src/state.ts | 1 + packages/fs/fs-local/src/fsio.ts | 1 + packages/sandbox/sandbox/src/index.ts | 1 + .../session-persistence-jsonl/src/index.ts | 5 +++++ packages/skill/skill-local/src/index.ts | 1 + 6 files changed, 10 insertions(+) diff --git a/packages/context/workspace-context/src/files.ts b/packages/context/workspace-context/src/files.ts index feb6304b4c..770024c569 100644 --- a/packages/context/workspace-context/src/files.ts +++ b/packages/context/workspace-context/src/files.ts @@ -459,6 +459,7 @@ export async function readScopeInstruction( signal?: AbortSignal, ): Promise { const content = await readBounded(file, maxSourceBytes, fileSystem, signal) + /* v8 ignore next -- Windows cannot reproduce a post-probe unreadable file with POSIX mode bits. */ if (content === undefined) return undefined return { absolutePath: file.absolutePath, diff --git a/packages/context/workspace-context/src/state.ts b/packages/context/workspace-context/src/state.ts index 98b8fcc066..ab18f442f4 100644 --- a/packages/context/workspace-context/src/state.ts +++ b/packages/context/workspace-context/src/state.ts @@ -437,6 +437,7 @@ export async function reconcileInstructionContext( ) continue const file = await readScopeInstruction(probedFile, resolved.maxSourceBytes, fileSystem, options.signal) + /* v8 ignore next -- Windows cannot make the probed file unreadable through POSIX mode bits. */ if (file === undefined) continue const currentDigest = instructionContentSha1(file.content) const nextVersion: InstructionVersionState = { diff --git a/packages/fs/fs-local/src/fsio.ts b/packages/fs/fs-local/src/fsio.ts index 4603611ce4..9592ba0349 100644 --- a/packages/fs/fs-local/src/fsio.ts +++ b/packages/fs/fs-local/src/fsio.ts @@ -175,6 +175,7 @@ export async function resolveLocalTarget(cwd: string, path: string): Promise { await mkdir(this.root, { recursive: true, mode: 0o700 }) await this.syncDirPosix(dirname(this.root)) @@ -213,6 +214,7 @@ export class SessionPersistenceJsonl extends SessionPersistence implements Persi /* v8 ignore next -- redundant temp link; publish already durable, rm failure is an unreachable IO edge */ } } + /* v8 ignore stop */ /* v8 ignore start -- native Windows coverage exercises this integration path */ private async materializeWin32(dir: string, finalPath: string, id: SessionId, content: string): Promise { @@ -254,6 +256,7 @@ export class SessionPersistenceJsonl extends SessionPersistence implements Persi } /** fsync a POSIX directory so a just-created/renamed entry is crash-durable. */ + /* v8 ignore start -- Windows uses write-through namespace operations; POSIX coverage exercises directory fsync. */ private async syncDirPosix(dir: string): Promise { const handle = await open(dir, 'r') try { @@ -262,6 +265,7 @@ export class SessionPersistenceJsonl extends SessionPersistence implements Persi await handle.close() } } + /* v8 ignore stop */ /** * Append and fsync event lines. On a partial write or sync failure, restore the @@ -395,6 +399,7 @@ export class SessionPersistenceJsonl extends SessionPersistence implements Persi await this.assertLogParentAllowsAbsence(path) return false } + /* v8 ignore next -- Windows repairs ENOTDIR from ENOENT above; POSIX covers direct ENOTDIR. */ throw error } } diff --git a/packages/skill/skill-local/src/index.ts b/packages/skill/skill-local/src/index.ts index ee109fbb16..29f5c622b9 100644 --- a/packages/skill/skill-local/src/index.ts +++ b/packages/skill/skill-local/src/index.ts @@ -317,6 +317,7 @@ async function nodeEntryKind(fullPath: string, entry: { isDirectory(): boolean; const info = await stat(fullPath) if (info.isDirectory()) return 'directory' if (info.isFile()) return 'file' + /* v8 ignore next -- The special-file symlink fixture relies on POSIX /dev/null. */ return undefined } catch (error) { ctx.logger.warn(`skill entry ${fullPath} ignored: failed to follow symbolic link: ${errorMessage(error)}`)