diff --git a/.gitattributes b/.gitattributes index 9e627ed8f..80c3b7b1d 100644 --- a/.gitattributes +++ b/.gitattributes @@ -2,3 +2,7 @@ # a union merge keeps both instead of stopping the stack sync on an add/add conflict. The # src/adr-index.repo.test.ts check keeps the table complete and in order. docs/internal/adr/README.md merge=union + +# why: a Windows checkout would otherwise turn text files into CRLF, which breaks the tests that +# compare file text and the scripts bash runs. +* text=auto eol=lf diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a0f1e0fe8..10683e40f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -68,6 +68,36 @@ jobs: - name: Unit tests run: pnpm run test:unit + # why: the Windows paths are otherwise tested only by passing `platform: "win32"` on Linux; + # bash is Git Bash, which the repository's tooling needs on Windows (ADR 0087 section 6). + windows-unit: + name: Unit tests (Windows) + runs-on: windows-2025 + permissions: + contents: read + timeout-minutes: 30 + defaults: + run: + shell: bash + steps: + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + persist-credentials: false + - uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0 + with: + node-version: 22 + - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 + with: + python-version: "3.13" + - name: Enable Corepack + run: | + corepack enable + corepack prepare pnpm@12.8.1+sha512.f64ba907507f5ceafe06c8d38e6052d0179444580ec1279ddd5bfc11cb48aa8a2644b66598e07e761da84872a9fc57d5f902b87fa49d024198d558612aabbe45 --activate + - name: Install dependencies + run: pnpm install --frozen-lockfile --ignore-scripts + - name: Unit tests + run: pnpm run test:unit + timing: name: Timing tests runs-on: ubuntu-24.04 @@ -126,7 +156,7 @@ jobs: # by a failed need would count as passed. quality: name: Quality - needs: [static, unit, timing, e2e] + needs: [static, unit, windows-unit, timing, e2e] if: always() runs-on: ubuntu-24.04 permissions: {} diff --git a/docs/internal/agent-rules/testing.md b/docs/internal/agent-rules/testing.md index 94af71a6c..2712b1998 100644 --- a/docs/internal/agent-rules/testing.md +++ b/docs/internal/agent-rules/testing.md @@ -73,7 +73,11 @@ here and moves into its module's test file. guesses. Check out the base commit, run the same test, and let the result decide; a failure that reproduces there is not yours to fix in this change, and one that does not reproduce is yours. Never skip, disable, or - quarantine a test to get to green. + quarantine a test to get to green. A test of a fact Windows does not have + (a POSIX mode, a launchd file) is skipped on `win32`: that is not + skipping to get to green. Until the Windows feature ends, the files on + `src/test-support/windows-skipped.ts` are left out of the Windows job + too, and that list only shrinks. Most flakes are written, not found: an assertion on a deadline, a duration, a throughput or a frame time without a fake clock passes on an idle machine and fails on a loaded runner. A bound on real time diff --git a/docs/internal/agent-rules/toolchain.md b/docs/internal/agent-rules/toolchain.md index e91edab39..4bd24efa1 100644 --- a/docs/internal/agent-rules/toolchain.md +++ b/docs/internal/agent-rules/toolchain.md @@ -64,9 +64,13 @@ list and this one the same. `.fallowrc.json` limits, and refactoring targets never fail. Its findings show as annotations on the PR. A `fallow-ignore` comment names its reason after ` -- `, and one that no longer hides a finding fails. The `pnpm - check` steps run as parallel jobs (static checks, unit tests, the timing - tests, the e2e lane in three shards); the Quality check passes only when all of them - do. The console DOM tests run with the unit tests. The console lane runs + check` steps run as parallel jobs (static checks, unit tests, the unit + tests on Windows, the timing tests, the e2e lane in three shards); the + Quality check passes only when all of them do. A contributor on Windows + runs the tests from Git Bash with Python 3 installed, never PowerShell. A + failure only the `Unit tests (Windows)` job shows is reproduced by + rerunning that job on the base commit's CI run (`gh run rerun --job + `), not locally. The console DOM tests run with the unit tests. The console lane runs in Chromium in two shards (the required Console check passes only when they all do) on every push to `main`, and on a pull request when it changes a source, UI, console spec or build file. diff --git a/src/docs-audience.repo.test.ts b/src/docs-audience.repo.test.ts index e36b8836d..f610cbdf0 100644 --- a/src/docs-audience.repo.test.ts +++ b/src/docs-audience.repo.test.ts @@ -123,7 +123,7 @@ const REPO_PATH = const printingSources = trackedFiles.filter( (name) => /^(?:src|ui\/src)\/.+\.tsx?$/.test(name) && - !/\.test\.tsx?$|(?:^|\/)testing\.ts$|(?:^|\/)test-[^/]*$/.test(name), + !/\.test\.tsx?$|(?:^|\/)testing\.ts$|(?:^|\/)test-[^/]*$|^src\/test-support\//.test(name), ); function repoPaths(name: string, text: string): string[] { diff --git a/src/ports/filesystem.ts b/src/ports/filesystem.ts index 2cc36f8f8..398c56b49 100644 --- a/src/ports/filesystem.ts +++ b/src/ports/filesystem.ts @@ -510,7 +510,7 @@ export class MemoryFilesystem implements Filesystem { } async readFile(path: string): Promise { - this.#failIfDefined(path); + path = this.#failIfDefined(path); const entry = this.#entryAt(path); if (entry.kind !== "file") { @@ -529,7 +529,7 @@ export class MemoryFilesystem implements Filesystem { body: ReadableStream, options: { readonly mode?: number } = {}, ): Promise { - this.#failIfDefined(path); + path = this.#failIfDefined(path); path = this.#underResolvedParent(path); this.#requireDirectory(parentPath(path)); if (this.#entries.has(path)) throw errnoError("EEXIST", `File already exists: ${path}`); @@ -549,7 +549,7 @@ export class MemoryFilesystem implements Filesystem { } async openFile(path: string): Promise { - this.#failIfDefined(path); + path = this.#failIfDefined(path); const entry = this.#entryAt(path); if (entry.kind !== "file") throw errnoError("EISDIR", `Is a directory: ${path}`); const bytes = fileBytes(entry); @@ -573,8 +573,8 @@ export class MemoryFilesystem implements Filesystem { to: string, _options: { readonly timeoutMs: number }, ): Promise { - this.#failIfDefined(from); - this.#failIfDefined(to); + from = this.#failIfDefined(from); + to = this.#failIfDefined(to); this.#rawEntryAt(from); if (this.#entries.has(to)) throw errnoError("EEXIST", `File already exists: ${to}`); this.#requireDirectory(parentPath(to)); @@ -602,7 +602,7 @@ export class MemoryFilesystem implements Filesystem { contents: string, options?: WriteFileAtomicOptions, ): Promise { - this.#failIfDefined(path); + path = this.#failIfDefined(path); path = this.#underResolvedParent(path); this.#requireDirectory(parentPath(path)); this.#entries.set(path, { @@ -616,7 +616,7 @@ export class MemoryFilesystem implements Filesystem { contents: string, options: { readonly mode: number }, ): Promise { - this.#failIfDefined(path); + path = this.#failIfDefined(path); path = this.#underResolvedParent(path); const existing = this.#entries.get(path); @@ -635,7 +635,7 @@ export class MemoryFilesystem implements Filesystem { contents: string, options?: WriteFileExclusiveOptions, ): Promise { - this.#failIfDefined(path); + path = this.#failIfDefined(path); path = this.#underResolvedParent(path); if (this.#entries.has(path)) { @@ -650,7 +650,7 @@ export class MemoryFilesystem implements Filesystem { } async mkdirp(path: string, options: MkdirpOptions = {}): Promise { - this.#failIfDefined(path); + path = this.#failIfDefined(path); let currentPath = ""; for (const segment of path.split("/")) { @@ -678,8 +678,8 @@ export class MemoryFilesystem implements Filesystem { * is what tells it another process won the race. */ async rename(from: string, to: string): Promise { - this.#failIfDefined(from); - this.#failIfDefined(to); + from = this.#failIfDefined(from); + to = this.#failIfDefined(to); const moved = this.#rawEntryAt(from); const occupant = this.#entries.get(to); @@ -714,7 +714,7 @@ export class MemoryFilesystem implements Filesystem { } async rm(path: string): Promise { - this.#failIfDefined(path); + path = this.#failIfDefined(path); const prefix = path.endsWith("/") ? path : `${path}/`; for (const entryPath of this.#entries.keys()) { @@ -725,7 +725,7 @@ export class MemoryFilesystem implements Filesystem { } async stat(path: string): Promise { - this.#failIfDefined(path); + path = this.#failIfDefined(path); const entry = this.#entryAt(path); return { @@ -738,14 +738,14 @@ export class MemoryFilesystem implements Filesystem { } async lstat(path: string): Promise { - this.#failIfDefined(path); + path = this.#failIfDefined(path); const entry = this.#rawEntryAt(path); return { kind: entry.kind, uid: entry.uid, mode: entry.mode }; } async mkdir(path: string, options: { readonly mode?: number } = {}): Promise { - this.#failIfDefined(path); + path = this.#failIfDefined(path); path = this.#underResolvedParent(path); if (this.#entries.has(path)) { @@ -759,12 +759,12 @@ export class MemoryFilesystem implements Filesystem { } async chmod(path: string, mode: number): Promise { - this.#failIfDefined(path); + path = this.#failIfDefined(path); this.#rawEntryAt(path).mode = mode & 0o777; } async realpath(path: string): Promise { - this.#failIfDefined(path); + path = this.#failIfDefined(path); const resolved = this.#resolveLinks(path, 0); if (!this.#entries.has(resolved)) { @@ -775,7 +775,7 @@ export class MemoryFilesystem implements Filesystem { } async readdir(path: string): Promise { - this.#failIfDefined(path); + path = this.#failIfDefined(path); this.#requireDirectory(path); const prefix = path === "/" ? "/" : `${path}/`; const children = new Set(); @@ -802,7 +802,7 @@ export class MemoryFilesystem implements Filesystem { * the double pass for correct. */ async exists(path: string): Promise { - this.#failIfDefined(path); + path = this.#failIfDefined(path); try { this.#entryAt(path); @@ -827,10 +827,10 @@ export class MemoryFilesystem implements Filesystem { } async directorySize(path: string): Promise { + path = memoryPath(path); let total = 0; for (const name of await this.readdir(path)) { - const child = joinMemoryPath(path, name); - this.#failIfDefined(child); + const child = this.#failIfDefined(joinMemoryPath(path, name)); const entry = this.#rawEntryAt(child); if (entry.kind === "directory") total += await this.directorySize(child); else if (entry.kind === "file") total += fileBytes(entry).byteLength; @@ -839,14 +839,15 @@ export class MemoryFilesystem implements Filesystem { } async readlink(path: string): Promise { - this.#failIfDefined(path); + path = this.#failIfDefined(path); const entry = this.#rawEntryAt(this.#underResolvedParent(path)); if (entry.kind !== "symlink") throw errnoError("EINVAL", `Not a symbolic link: ${path}`); return entry.target; } - async replaceSymlink(path: string, target: string): Promise { - this.#failIfDefined(path); + async replaceSymlink(path: string, given: string): Promise { + path = this.#failIfDefined(path); + const target = memoryPath(given); const at = this.#underResolvedParent(path); const entry = this.#rawEntryAt(at); if (entry.kind !== "symlink") throw errnoError("EINVAL", `Not a symbolic link: ${path}`); @@ -854,7 +855,7 @@ export class MemoryFilesystem implements Filesystem { } async writeAt(path: string, offset: number, bytes: Uint8Array): Promise { - this.#failIfDefined(path); + path = this.#failIfDefined(path); const entry = this.#entryAt(path); if (entry.kind !== "file") throw errnoError("EISDIR", `Is a directory: ${path}`); const old = fileBytes(entry); @@ -870,18 +871,21 @@ export class MemoryFilesystem implements Filesystem { * reach the branches that turn an unexpected filesystem failure into a typed rejection. */ defineFailure(path: string, code: string): void { - this.#failures.set(path, code); + this.#failures.set(memoryPath(path), code); } defineSymlink(path: string, target: string): void { - this.#entries.set(path, this.#newEntry({ kind: "symlink", target })); + this.#entries.set( + memoryPath(path), + this.#newEntry({ kind: "symlink", target: memoryPath(target) }), + ); } defineAttributes( path: string, attributes: { readonly uid?: number; readonly mode?: number; readonly modifiedAtMs?: number }, ): void { - const entry = this.#rawEntryAt(path); + const entry = this.#rawEntryAt(memoryPath(path)); if (attributes.uid !== undefined) { entry.uid = attributes.uid; @@ -896,11 +900,14 @@ export class MemoryFilesystem implements Filesystem { } } - #failIfDefined(path: string): void { + /** why: every method that takes a path and can fail enters here, so the one place that fails an injected path is also the one that reads a path in either style. */ + #failIfDefined(given: string): string { + const path = memoryPath(given); const code = this.#failures.get(path); if (code !== undefined) { - throw errnoError(code, `Injected ${code} failure: ${path}`); + throw errnoError(code, `Injected ${code} failure: ${given}`); } + return path; } #newEntry(kind: MemoryEntryKind): MemoryEntry { @@ -976,6 +983,15 @@ function fileBytes(entry: { readonly contents: string; readonly bytes?: Uint8Arr return entry.bytes ?? Buffer.from(entry.contents, "utf8"); } +/** + * why: the fake reads `D:\a\b`, `\a\b` and `/a/b` as one entry, so a test written for the host's + * path style passes on every host; production code keeps `node:path`. + */ +function memoryPath(path: string): string { + const absolute = path.replace(/^[A-Za-z]:(?=[\\/]|$)/, ""); + return /^[\\/]/.test(absolute) ? absolute.replaceAll("\\", "/") : path; +} + function joinMemoryPath(parent: string, child: string): string { return parent === "/" || parent === "" ? `/${child}` : `${parent}/${child}`; } diff --git a/src/ports/memory-filesystem-paths.test.ts b/src/ports/memory-filesystem-paths.test.ts new file mode 100644 index 000000000..ddcbb09b5 --- /dev/null +++ b/src/ports/memory-filesystem-paths.test.ts @@ -0,0 +1,58 @@ +import { describe, expect, it } from "vitest"; + +import { MemoryFilesystem } from "./index.js"; + +const STYLES = ["D:\\a\\b", "\\a\\b", "D:/a/b", "/a/b"] as const; + +async function withTree(): Promise { + const filesystem = new MemoryFilesystem(); + await filesystem.mkdirp("/a"); + return filesystem; +} + +describe("MemoryFilesystem path styles", () => { + it("reads `D:\\a\\b`, `\\a\\b`, `D:/a/b` and `/a/b` as one entry, `C:\\a` and `D:\\a` as one, and returns the `/` form", async () => { + for (const written of STYLES) { + for (const read of STYLES) { + const filesystem = await withTree(); + await filesystem.writeFileAtomic(written, "x"); + expect(await filesystem.readFile(read), `write ${written}, read ${read}`).toBe("x"); + expect(await filesystem.readdir("D:\\a"), `readdir after ${written}`).toEqual(["b"]); + await filesystem.rename(read, "C:\\a\\c"); + expect(await filesystem.exists("/a/b"), `rename from ${read}`).toBe(false); + expect(await filesystem.readFile("/a/c")).toBe("x"); + await filesystem.rm(read === "/a/b" ? "D:\\a\\c" : "\\a\\c"); + expect(await filesystem.exists("/a/c")).toBe(false); + } + } + + const made = new MemoryFilesystem(); + await made.mkdirp("D:\\x\\y"); + expect((await made.lstat("/x/y")).kind).toBe("directory"); + expect(await made.realpath("D:\\x")).toBe("/x"); + + const linked = await withTree(); + linked.defineSymlink("/link", "D:\\a"); + await linked.writeFileAtomic("/a/f", "y"); + expect(await linked.realpath("/link")).toBe("/a"); + expect(await linked.readFile("/link/f")).toBe("y"); + + const injected = await withTree(); + injected.defineFailure("D:\\a\\f", "EIO"); + await expect(injected.readFile("/a/f")).rejects.toMatchObject({ code: "EIO" }); + + const replaced = await withTree(); + replaced.defineSymlink("/link", "/a"); + await replaced.replaceSymlink("/link", "D:\\a\\other"); + expect(await replaced.readlink("/link")).toBe("/a/other"); + + const relative = new MemoryFilesystem(); + relative.defineFailure("rel\\file", "EIO"); + await expect(relative.readFile("rel\\file")).rejects.toMatchObject({ code: "EIO" }); + await expect(relative.readFile("/rel/file")).rejects.toMatchObject({ code: "ENOENT" }); + await expect(relative.readFile("rel/file")).rejects.toMatchObject({ code: "ENOENT" }); + + const missing = new MemoryFilesystem(); + await expect(missing.readFile("D:\\nope")).rejects.toThrow(/D:\\nope|\/nope/); + }); +}); diff --git a/src/test-lanes.repo.test.ts b/src/test-lanes.repo.test.ts index df3e0b01d..24316e3dd 100644 --- a/src/test-lanes.repo.test.ts +++ b/src/test-lanes.repo.test.ts @@ -5,6 +5,8 @@ import { fileURLToPath } from "node:url"; import { describe, expect, it } from "vitest"; +import { windowsSkipped } from "./test-support/windows-skipped.js"; + const REPO_ROOT = join(dirname(fileURLToPath(import.meta.url)), ".."); const packageJson = JSON.parse(readFileSync(join(REPO_ROOT, "package.json"), "utf8")) as { @@ -211,3 +213,40 @@ describe("the console lane in CI (.github/workflows/ci.yml)", () => { } }); }); + +describe("the Windows unit job in CI (.github/workflows/ci.yml)", () => { + it("runs `pnpm run test:unit` as `Unit tests (Windows)` on windows-2025 under bash with a 30 minute limit, `quality` needs it, and text files check out with LF", () => { + const ci = readFileSync(join(REPO_ROOT, ".github/workflows/ci.yml"), "utf8"); + const attributes = readFileSync(join(REPO_ROOT, ".gitattributes"), "utf8"); + const jobs = ciJobs(ci); + const windows = jobs.get("windows-unit") ?? ""; + + expect(windows, "a job `windows-unit`").not.toBe(""); + expect(windows).toMatch(/\n {4}name: Unit tests \(Windows\)\n/); + expect(windows).toContain("runs-on: windows-2025"); + expect(windows).toMatch(/\n {6}shell: bash\n|\n {4}defaults:\n {6}run:\n {8}shell: bash\n/); + expect(windows).toContain("timeout-minutes: 30"); + expect(windows).toMatch(/run: pnpm run test:unit\n/); + expect(jobs.get("quality")).toMatch(/needs:\s*\[[^\]]*\bwindows-unit\b/); + expect(attributes.split("\n")).toContain("* text=auto eol=lf"); + }); +}); + +describe("the files the Windows job leaves out (src/test-support/windows-skipped.ts)", () => { + it("`windowsSkipped` is the list on win32 and empty on linux and darwin, holds sorted tracked test files once each, and `vitest.config.ts` gives it to the `unit` project only", () => { + const tracked = new Set( + spawnSync("git", ["ls-files"], { cwd: REPO_ROOT, encoding: "utf8" }).stdout.split("\n"), + ); + const list = windowsSkipped("win32"); + const config = readFileSync(join(REPO_ROOT, "vitest.config.ts"), "utf8"); + const unitProject = /name:\s*"unit"[\s\S]*?name:\s*"ui-dom"/.exec(config)?.[0] ?? ""; + + expect(windowsSkipped("linux")).toEqual([]); + expect(windowsSkipped("darwin")).toEqual([]); + expect(list).toEqual([...new Set(list)].sort()); + expect(list.filter((path) => !tracked.has(path))).toEqual([]); + expect(list.filter((path) => !/\.test\.tsx?$/.test(path))).toEqual([]); + expect(unitProject).toContain("...windowsSkipped(process.platform)"); + expect(config.match(/windowsSkipped\(/g)).toHaveLength(1); + }); +}); diff --git a/src/test-support/AGENTS.md b/src/test-support/AGENTS.md index 555556463..5ac59a048 100644 --- a/src/test-support/AGENTS.md +++ b/src/test-support/AGENTS.md @@ -10,5 +10,7 @@ Does: test-only helpers shared across modules; excluded from the build. - A repo-wide grep over source runs on `blankSource` output: it blanks comments (and with `strings`, string and template text) and keeps every newline, so a match is code, at the right line. +- `windows-skipped.ts` is the one list of test files the Windows CI job leaves out (ADR 0087); + it is read on a Windows host only and only shrinks. - `promiseState` reads whether a promise settled without awaiting it, so a broken timer fails on an assertion, not a test timeout. diff --git a/src/test-support/windows-skipped.ts b/src/test-support/windows-skipped.ts new file mode 100644 index 000000000..acd2836ee --- /dev/null +++ b/src/test-support/windows-skipped.ts @@ -0,0 +1,146 @@ +/** + * why: ADR 0087 section 4: the test files the `Unit tests (Windows)` job leaves out until a later + * task fixes them. Sorted, repo-relative; a task takes entries off and none is ever added. + */ +const WINDOWS_SKIPPED: readonly string[] = [ + "src/agent-device/host/agent-device-supervisor-state.test.ts", + "src/agent-device/host/install.test.ts", + "src/agent-device/rig-ports.e2e.test.ts", + "src/budget-guard.test.ts", + "src/ci-failures.test.ts", + "src/claim.test.ts", + "src/cli/index-auto-launch-handshake.test.ts", + "src/cli/index-daemon-service.test.ts", + "src/cli/index-daemon-status.test.ts", + "src/cli/index-device-config.test.ts", + "src/cli/index-events-mcp-smoke.test.ts", + "src/cli/index-files.test.ts", + "src/cli/index.test.ts", + "src/cli/passthrough.test.ts", + "src/cli/tunnel-forward-and-emulator.test.ts", + "src/clock-hook.test.ts", + "src/core/device-root.test.ts", + "src/core/instance-identity.test.ts", + "src/core/registry.test.ts", + "src/daemon/connection-host.test.ts", + "src/daemon/device-data-tables.test.ts", + "src/daemon/dispatcher-events.test.ts", + "src/daemon/dispatcher-usage.test.ts", + "src/daemon/driver-discovery.test.ts", + "src/daemon/gateway-fleet.e2e.test.ts", + "src/daemon/identity-uplink.e2e.test.ts", + "src/daemon/lease-files.test.ts", + "src/daemon/main-agent-device.test.ts", + "src/daemon/main-history.test.ts", + "src/daemon/main-host-load.test.ts", + "src/daemon/main-start-daemon.test.ts", + "src/daemon/main-state-db.test.ts", + "src/daemon/main-stop.test.ts", + "src/daemon/main-update.test.ts", + "src/daemon/main-worker-lock.test.ts", + "src/daemon/main.test.ts", + "src/daemon/optional-modules-start.test.ts", + "src/daemon/optional-modules-stop.test.ts", + "src/daemon/optional-modules.test.ts", + "src/daemon/relay-gateway-bodies.e2e.test.ts", + "src/daemon/relay-gateway-cancel.e2e.test.ts", + "src/daemon/relay-gateway-capacity.e2e.test.ts", + "src/daemon/relay-gateway-files.e2e.test.ts", + "src/daemon/relay-gateway.e2e.test.ts", + "src/daemon/relay-worker.e2e.test.ts", + "src/daemon/remote-client.e2e.test.ts", + "src/daemon/server-claim-and-stop.test.ts", + "src/daemon/server-drivers.test.ts", + "src/daemon/server-leases.test.ts", + "src/daemon/server-pushes-gateway.test.ts", + "src/daemon/server-pushes.test.ts", + "src/daemon/server-requests.test.ts", + "src/daemon/server-roles.test.ts", + "src/daemon/server-startup.test.ts", + "src/daemon/server-update.test.ts", + "src/daemon/server.test.ts", + "src/daemon/session-path.e2e.test.ts", + "src/delivery-stats.test.ts", + "src/docs-surface-check.test.ts", + "src/drivers/android/device-table.test.ts", + "src/drivers/android/index-boot.test.ts", + "src/drivers/android/index-copies-recovery.test.ts", + "src/drivers/android/index-device-tcp.test.ts", + "src/drivers/android/index-image-fit.test.ts", + "src/drivers/android/index-launch.test.ts", + "src/drivers/android/index-lifecycle.test.ts", + "src/drivers/android/index-profiles-components.test.ts", + "src/drivers/android/index-screen-capture.test.ts", + "src/drivers/android/index.test.ts", + "src/drivers/android/physical-handler-inspect-list.test.ts", + "src/drivers/android/physical-handler-network.test.ts", + "src/drivers/android/physical-handler-passthrough.test.ts", + "src/drivers/android/physical-handler.test.ts", + "src/drivers/android/seeds-copies.test.ts", + "src/drivers/android/seeds-library-and-fit.test.ts", + "src/drivers/android/two-instances.test.ts", + "src/drivers/ios/boot-courtesies.test.ts", + "src/drivers/ios/boot-deadline.test.ts", + "src/drivers/ios/devicectl-passthrough.test.ts", + "src/drivers/ios/index-component-install.test.ts", + "src/drivers/ios/index-device-set.test.ts", + "src/drivers/ios/index-list-components.test.ts", + "src/drivers/ios/index-passthrough.test.ts", + "src/drivers/ios/index-provenance-root.test.ts", + "src/drivers/ios/index-remove-component.test.ts", + "src/drivers/ios/index-save-source-lifecycle.test.ts", + "src/drivers/ios/index-seed-provision.test.ts", + "src/drivers/ios/index-seed-record.test.ts", + "src/drivers/ios/index-seed-sources.test.ts", + "src/drivers/ios/index-seed-swap.test.ts", + "src/drivers/ios/index-seed-throwaway.test.ts", + "src/drivers/ios/index-simulator-audio.test.ts", + "src/drivers/ios/index-slim-mode.test.ts", + "src/drivers/ios/index-slim-resolve-advisories.test.ts", + "src/drivers/ios/index.test.ts", + "src/drivers/ios/physical-files-and-limits.test.ts", + "src/drivers/ios/physical-presence.test.ts", + "src/drivers/ios/physical.test.ts", + "src/drivers/ios/slim-except.test.ts", + "src/drivers/ios/slim-named-services.test.ts", + "src/fast-track.test.ts", + "src/gateway/boundary.test.ts", + "src/gateway/dispatcher-reads.test.ts", + "src/history/history.test.ts", + "src/instructions/setup.test.ts", + "src/lint-rules.test.ts", + "src/manual-hook.test.ts", + "src/mcp/main.test.ts", + "src/merge-pr.test.ts", + "src/mutate.test.ts", + "src/ports/daemon-launcher.test.ts", + "src/ports/filesystem.test.ts", + "src/ports/host-load.test.ts", + "src/ports/ipc.test.ts", + "src/ports/logger.test.ts", + "src/ports/npm-cli.test.ts", + "src/ports/paths.test.ts", + "src/ports/process-runner.test.ts", + "src/ports/service-manager.test.ts", + "src/ports/sqlite.test.ts", + "src/ports/updater-launcher.test.ts", + "src/ports/uplink-websocket.test.ts", + "src/ports/worker-lock.test.ts", + "src/pr-body-check.test.ts", + "src/recurring-findings.test.ts", + "src/refactor-check.test.ts", + "src/release-pack.test.ts", + "src/review-inputs.test.ts", + "src/simlock-client/no-core-leak.test.ts", + "src/slow-e2e.test.ts", + "src/state/state.test.ts", + "src/test-support/imports.test.ts", + "src/tool-guard.test.ts", + "src/updater/index.test.ts", + "src/worktree-script.test.ts", + "ui/src/ds/contrast.test.ts", +]; + +export function windowsSkipped(platform: string): readonly string[] { + return platform === "win32" ? WINDOWS_SKIPPED : []; +} diff --git a/vitest.config.ts b/vitest.config.ts index f1e7ced22..8488c8739 100644 --- a/vitest.config.ts +++ b/vitest.config.ts @@ -1,5 +1,7 @@ import { defineConfig } from "vitest/config"; +import { windowsSkipped } from "./src/test-support/windows-skipped.js"; + export default defineConfig({ test: { // strictTags (default in vitest 4.1) rejects any tag not declared here or on a @@ -25,6 +27,8 @@ export default defineConfig({ "src/**/*.timing.test.ts", "packages/*/src/**/*.timing.test.ts", "ui/**/*.dom.test.tsx", + // why: files that still fail on Windows, read on a Windows host only (ADR 0087). + ...windowsSkipped(process.platform), ], // why: the script tests under src/ spawn node, git and a fake gh per case; under a full // parallel run the default five seconds times three of them out (lint-rules, claim,