Skip to content

The unit tests run on Windows in CI, with a shrinking list of the files still failing there #1705

Open

Description

@V3RON

Part of #1693.

Scope

Every push and pull request runs pnpm test:unit on a Windows runner, and the required Quality check fails when it fails. The files that still fail on Windows are left out there through one list that later tasks shrink; the in-memory fake filesystem reads Windows and POSIX paths as one; and text files check out with LF. After this PR, every later PR of #1693's stack is checked on Windows; main gets the job when the stack merges.

If it goes wrong, a contributor sees Quality red on a PR that broke nothing (a flaky or slow Windows file left off the list), or a file that fails on Windows is quietly not run.

Technical spec

Commit 2df19f8.

Rows

  • Behaviours: B1, B2, B3
  • Interfaces: I1, I2, I3
  • Existing code: X1, X2, X3, X4, X5, X6, X7, X13, X14, X16, X17

Facts

# Fact Source
F1 The unit job installs with --ignore-scripts and runs pnpm run test:unit; its steps are the ones I2 copies. .github/workflows/ci.yml:49-69
F2 The unit project's excludes are written inline in its block; src/test-lanes.repo.test.ts checks that block's text for *.timing.test.ts. vitest.config.ts:23-28, src/test-lanes.repo.test.ts:141-146
F3 The fake keeps entries in one Map keyed by path text, with / as its root. src/ports/filesystem.ts:501, src/ports/filesystem.ts:509
F4 On Windows 11 at this commit, a Proxy wrapper that read paths per I3 fixed 449 failing tests in src/drivers, src/core, src/daemon, src/ports and src/cli and newly failed 5: four subclasses with private fields and one test that stubs readFile and compares the raw path. Done in the class itself (I3), neither applies. pnpm exec vitest run --project unit src/drivers src/core src/daemon src/ports src/cli --reporter=json before and after memfs-normalize.mjs on DesktopWindows, 2026-11-18
F5 At this commit, 138 of 2,184 files fail on Windows 11 (1,664 of 9,544 tests); the run took 4 min 50 s on 16 cores. pnpm exec vitest run --project unit --project ui-dom --reporter=json on DesktopWindows, 2026-11-18
F6 tsconfig.json has rootDir: "src", so the list lives under src/ to be imported by src/test-lanes.repo.test.ts. tsconfig.json

Modules touched

Searches: rg -n "quality|runs-on|test:unit" .github/workflows/ci.yml src/test-lanes.repo.test.ts, rg -n "class MemoryFilesystem|parentPath|joinMemoryPath|realpath|readlink|defineSymlink|replaceSymlink" src/ports/filesystem.ts. #1698 (feature #1691) changes MemoryFilesystem.writeFileAtomic in the same class; whichever merges second resolves the overlap.

  • .github/workflows/ci.yml, .gitattributes, vitest.config.ts
  • src/test-support/windows-skipped.ts (new), src/test-support/AGENTS.md
  • src/ports/filesystem.ts, src/ports/filesystem.test.ts or a new src/ports/memory-filesystem-paths.test.ts
  • src/test-lanes.repo.test.ts
  • docs/internal/agent-rules/testing.md, docs/internal/agent-rules/toolchain.md

Rules in play

  • ADR 0087 §1–§4: the job, the fake, POSIX-only skips, the list.
  • docs/internal/agent-rules/testing.md rule 5: the two sentences X13 names.
  • docs/internal/agent-rules/toolchain.md: X14's three lines; the tool guard's list is unchanged.
  • Ports manual: the fake stays in filesystem.ts beside its interface and adapter.

Tests

The seams are src/test-lanes.repo.test.ts (B1, B2; model on its quality and console-lane cases) and MemoryFilesystem from src/ports/index.ts (B3; model on src/ports/filesystem.test.ts).

  • B1: the windows-unit job exists, named Unit tests (Windows), on windows-2025, shell: bash, timeout-minutes: 30, running pnpm run test:unit; quality needs it; .gitattributes holds * text=auto eol=lf
  • B2: windowsSkipped("win32") is the list, "linux" and "darwin" give []; every listed path is a tracked test file; sorted, no duplicate; vitest.config.ts passes windowsSkipped(process.platform) to the unit project only
  • B3: D:\a\b, \a\b, D:/a/b and /a/b name one entry for writeFileAtomic→readFile, mkdirp→lstat, readdir, rename across styles, rm; C:\a and D:\a one entry; realpath("D:\\a") returns /a; a link to D:\a resolves to /a; a relative path as today; an error names the caller's path or the / form

Done when

  • pnpm test:changed passes on the branch.
  • The list holds every file that failed in any of three runs of the Unit tests (Windows) job made before the list was filled (the PR lists the three run links); then the job passes on the PR's head, and Quality needs it.
  • toolchain.md names the Windows job, the Git Bash and Python 3 requirement, and how to rerun the Windows job on a base commit; testing.md rule 5 holds X13's two sentences.

Out of scope

  • Fixing any listed file (T2–T6).
  • The e2e lane on Windows.

Depends on

Written by an agent.

Activity

  1. added
    task:draftScope written; technical spec or its spec check missing.
    os:windowsRuns on, or affects, Windows hosts
    on Nov 18, 2026
  2. added
    task:readySpec checked. An agent may implement it once its Depends on allow.
    and removed
    task:draftScope written; technical spec or its spec check missing.
    on Nov 18, 2026
  3. self-assigned this
    on Nov 18, 2026
  4. V3RON commented on Nov 18, 2026

    @V3RON
    ContributorAuthor

    Handoff

    Done: build complete on PR #1722 (head cd00f14). The Windows job is in CI and Quality needs it. The list has 138 files, taken from three attempts of run 44313709167. Three files were added later after Windows-only failures: rig-ports.e2e (EBUSY), docs-surface-check (timeout), host-load. ADR PR #1703 passed review (R1 fixed) and is at the bottom of stack #1703 → #1722.

    Not done: the audit, review, gh pr ready, and tasks #1706–#1710 and #1712.

    Findings: none open. The PR body has 4 Assumption lines.

    Blocked on: nothing. The run was paused because DesktopWindows went offline. Resume with implement audit on #1722 (CI only, no DesktopWindows needed), then review round 1.

    Written by an agent.

  5. V3RON commented on Nov 18, 2026

    @V3RON
    ContributorAuthor

    Handoff

    Done: audit (fixed a memoryPath line that had leaked into NodeFilesystem.directorySize, added two test cases), review round 1 (R1, R2), one fix run, fix-check. PR #1722 head 7fee05c, still draft. R2 (the #failIfDefined doc) is fixed and verified.

    Not done: gh pr ready, joining the stack as reviewed, tasks #1706–#1710 and #1712 (all wait on #1705). The Windows job on 7fee05c was still queued on GitHub's runners.

    Findings: R1 is still blocking after the review cap (rule 14). src/ports/memory-filesystem-paths.test.ts:50: the relative-path case stays green when memoryPath turns rel\file into rel/file. Fix: assert rel/file stays ENOENT while rel\file carries the injected failure.

    Blocked on: the maintainer. Either allow one more fix run plus a check of that hunk, or fix the assertion yourself. Then re-run deliver #1693.

    Written by an agent.

  6. added
    task:blockedAgent stopped on a blocker in its handoff. Maintainer re-adds the label it came from.
    and removed
    task:readySpec checked. An agent may implement it once its Depends on allow.
    on Nov 18, 2026
  7. removed their assignment
    on Nov 18, 2026
  8. added
    task:readySpec checked. An agent may implement it once its Depends on allow.
    and removed
    task:blockedAgent stopped on a blocker in its handoff. Maintainer re-adds the label it came from.
    on Nov 18, 2026
  9. self-assigned this
    on Nov 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

os:windowsRuns on, or affects, Windows hoststask:readySpec checked. An agent may implement it once its Depends on allow.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions