test(windows): mark platform-only coverage branches
This commit is contained in:
@@ -459,6 +459,7 @@ export async function readScopeInstruction(
|
|||||||
signal?: AbortSignal,
|
signal?: AbortSignal,
|
||||||
): Promise<LoadedInstructionFile | undefined> {
|
): Promise<LoadedInstructionFile | undefined> {
|
||||||
const content = await readBounded(file, maxSourceBytes, fileSystem, signal)
|
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
|
if (content === undefined) return undefined
|
||||||
return {
|
return {
|
||||||
absolutePath: file.absolutePath,
|
absolutePath: file.absolutePath,
|
||||||
|
|||||||
@@ -437,6 +437,7 @@ export async function reconcileInstructionContext(
|
|||||||
) continue
|
) continue
|
||||||
|
|
||||||
const file = await readScopeInstruction(probedFile, resolved.maxSourceBytes, fileSystem, options.signal)
|
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
|
if (file === undefined) continue
|
||||||
const currentDigest = instructionContentSha1(file.content)
|
const currentDigest = instructionContentSha1(file.content)
|
||||||
const nextVersion: InstructionVersionState = {
|
const nextVersion: InstructionVersionState = {
|
||||||
|
|||||||
@@ -175,6 +175,7 @@ export async function resolveLocalTarget(cwd: string, path: string): Promise<Loc
|
|||||||
function pathType(info: Stats | BigIntStats): PathInfo['type'] {
|
function pathType(info: Stats | BigIntStats): PathInfo['type'] {
|
||||||
if (info.isFile()) return 'file'
|
if (info.isFile()) return 'file'
|
||||||
if (info.isDirectory()) return 'directory'
|
if (info.isDirectory()) return 'directory'
|
||||||
|
/* v8 ignore next -- Windows does not expose Unix-domain socket paths as special filesystem entries. */
|
||||||
return 'other'
|
return 'other'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -110,6 +110,7 @@ declare module 'cordis' {
|
|||||||
*/
|
*/
|
||||||
export abstract class SandboxProvider extends Service {
|
export abstract class SandboxProvider extends Service {
|
||||||
constructor(ctx: Context) {
|
constructor(ctx: Context) {
|
||||||
|
/* v8 ignore next -- Windows has no sandbox backend to instantiate this service. */
|
||||||
super(ctx, 'sandbox')
|
super(ctx, 'sandbox')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -180,6 +180,7 @@ export class SessionPersistenceJsonl extends SessionPersistence implements Persi
|
|||||||
return header + '\n' + body + '\n'
|
return header + '\n' + body + '\n'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* v8 ignore start -- Windows uses the Win32 durable-publish path; POSIX coverage exercises this peer. */
|
||||||
private async materializePosix(dir: string, finalPath: string, id: SessionId, content: string): Promise<void> {
|
private async materializePosix(dir: string, finalPath: string, id: SessionId, content: string): Promise<void> {
|
||||||
await mkdir(this.root, { recursive: true, mode: 0o700 })
|
await mkdir(this.root, { recursive: true, mode: 0o700 })
|
||||||
await this.syncDirPosix(dirname(this.root))
|
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 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 */
|
/* v8 ignore start -- native Windows coverage exercises this integration path */
|
||||||
private async materializeWin32(dir: string, finalPath: string, id: SessionId, content: string): Promise<void> {
|
private async materializeWin32(dir: string, finalPath: string, id: SessionId, content: string): Promise<void> {
|
||||||
@@ -254,6 +256,7 @@ export class SessionPersistenceJsonl extends SessionPersistence implements Persi
|
|||||||
}
|
}
|
||||||
|
|
||||||
/** fsync a POSIX directory so a just-created/renamed entry is crash-durable. */
|
/** 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<void> {
|
private async syncDirPosix(dir: string): Promise<void> {
|
||||||
const handle = await open(dir, 'r')
|
const handle = await open(dir, 'r')
|
||||||
try {
|
try {
|
||||||
@@ -262,6 +265,7 @@ export class SessionPersistenceJsonl extends SessionPersistence implements Persi
|
|||||||
await handle.close()
|
await handle.close()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
/* v8 ignore stop */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Append and fsync event lines. On a partial write or sync failure, restore the
|
* 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)
|
await this.assertLogParentAllowsAbsence(path)
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
/* v8 ignore next -- Windows repairs ENOTDIR from ENOENT above; POSIX covers direct ENOTDIR. */
|
||||||
throw error
|
throw error
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -317,6 +317,7 @@ async function nodeEntryKind(fullPath: string, entry: { isDirectory(): boolean;
|
|||||||
const info = await stat(fullPath)
|
const info = await stat(fullPath)
|
||||||
if (info.isDirectory()) return 'directory'
|
if (info.isDirectory()) return 'directory'
|
||||||
if (info.isFile()) return 'file'
|
if (info.isFile()) return 'file'
|
||||||
|
/* v8 ignore next -- The special-file symlink fixture relies on POSIX /dev/null. */
|
||||||
return undefined
|
return undefined
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
ctx.logger.warn(`skill entry ${fullPath} ignored: failed to follow symbolic link: ${errorMessage(error)}`)
|
ctx.logger.warn(`skill entry ${fullPath} ignored: failed to follow symbolic link: ${errorMessage(error)}`)
|
||||||
|
|||||||
Reference in New Issue
Block a user