From 228f6e3867ce4cdbbd2d4edb85ef132c91e5634c Mon Sep 17 00:00:00 2001 From: imccyu <276526105+imccyu@users.noreply.github.com> Date: Fri, 17 Jul 2026 15:44:19 +0800 Subject: [PATCH] test(windows): skip POSIX-only assertions --- .../workspace-context/tests/workspace-context.spec.ts | 2 +- packages/spill/spill-local/tests/spill-local.spec.ts | 2 +- packages/subagent/subagent-acp/tests/subagent-acp.spec.ts | 2 +- .../subagent-subprocess/tests/subagent-subprocess.spec.ts | 5 +++-- 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/packages/context/workspace-context/tests/workspace-context.spec.ts b/packages/context/workspace-context/tests/workspace-context.spec.ts index b3a9947221..5f04b3a485 100644 --- a/packages/context/workspace-context/tests/workspace-context.spec.ts +++ b/packages/context/workspace-context/tests/workspace-context.spec.ts @@ -2403,7 +2403,7 @@ describe('dynamic nested workspace context injection', () => { } }) - it('skips unreadable nested instruction files without attaching empty context', async () => { + it.skipIf(process.platform === 'win32')('skips unreadable nested instruction files without attaching empty context', async () => { const root = await tempRepo() const home = await tempRepo() try { diff --git a/packages/spill/spill-local/tests/spill-local.spec.ts b/packages/spill/spill-local/tests/spill-local.spec.ts index d73fca9fe3..b4abc6e3d6 100644 --- a/packages/spill/spill-local/tests/spill-local.spec.ts +++ b/packages/spill/spill-local/tests/spill-local.spec.ts @@ -84,7 +84,7 @@ describe('saveTextFile', () => { expect(saved.path.includes('/..')).toBe(false) }) - it('creates the session dir with owner-only permissions', async () => { + it.skipIf(process.platform === 'win32')('creates the session dir with owner-only permissions', async () => { const saved = await saveTextFile({ root, sessionId: 'sess-1', suggestedName: 'r.txt', content: 'x' }) // 0o700 dir, 0o600 file (masked by umask, but the owner bits must hold). expect(statSync(dirname(saved.path)).mode & 0o700).toBe(0o700) diff --git a/packages/subagent/subagent-acp/tests/subagent-acp.spec.ts b/packages/subagent/subagent-acp/tests/subagent-acp.spec.ts index bfc8476bae..e3fd3eda48 100644 --- a/packages/subagent/subagent-acp/tests/subagent-acp.spec.ts +++ b/packages/subagent/subagent-acp/tests/subagent-acp.spec.ts @@ -263,7 +263,7 @@ describe('dsh-subagent-acp', () => { } }) - it('escalates to SIGTERM for a child that ignores EOF but is not SIGTERM-trapping', async () => { + it.skipIf(process.platform === 'win32')('escalates to SIGTERM for a child that ignores EOF but is not SIGTERM-trapping', async () => { // A child that keeps its loop alive past stdin EOF (so the graceful window // times out) but exits cooperatively on SIGTERM must die on the SIGTERM tier // — dispose returns there, never reaching the SIGKILL tier. The child touches diff --git a/packages/subagent/subagent-subprocess/tests/subagent-subprocess.spec.ts b/packages/subagent/subagent-subprocess/tests/subagent-subprocess.spec.ts index bdc0260c73..8ed3891578 100644 --- a/packages/subagent/subagent-subprocess/tests/subagent-subprocess.spec.ts +++ b/packages/subagent/subagent-subprocess/tests/subagent-subprocess.spec.ts @@ -258,8 +258,9 @@ describe('createIsolatedConfigDir', () => { expect(dir.path.startsWith(join(tmpdir(), 'dsh-subagent-subprocess-test-'))).toBe(true) const st = await stat(dir.path) expect(st.isDirectory()).toBe(true) - // Private (0700) per the defensive-patterns temp-dir rule. - expect(st.mode & 0o777).toBe(0o700) + // Windows reports synthetic POSIX mode bits; privacy comes from the + // inherited directory ACL rather than chmod-compatible mode bits. + if (process.platform !== 'win32') expect(st.mode & 0o777).toBe(0o700) } finally { await dir.remove() }