Skip to content

[Bug]: wsl-attachment-paths.test.ts fails on native Windows since #296 (test portability) + remaining Windows capability baseline #298

Description

@Ralle1976

Product or interface

Source build or repository tooling

Version

Source @ ae65651 (0.5.1). Node.js v24.18.0, pnpm 9.12.0.

Platform

Windows

OS version and architecture

Windows 11 x64 (build 26200). No Developer Mode (no unprivileged symlink privilege). Windows PowerShell 5.1 default; Git Bash present.

Issue area

Tests / verification gates

Steps to reproduce

  1. Build from source on Windows: npx pnpm@9.12.0 install --frozen-lockfile && pnpm build.
  2. pnpm test:capabilities

Expected and actual behavior

Since ae65651 (#296), packages/tui/test/unit/wsl-attachment-paths.test.ts fails 12 of 25 cases on native Windows, every one via:

Caused by: Error: wslpath did not return an absolute Linux path.
  ❯ resolveWslPath packages/tui/src/host/wsl-path.ts:37:13

Root cause: the suite's beforeEach feeds the host temp path back as mocked wslpath output (host.executeFile.mockResolvedValue({ stdout: ${imagePath}\n }) with imagePath = join(tmpdir(), …)). On POSIX CI that path is /tmp/…, which satisfies the production posix.isAbsolute(mapped) check. On native Windows it is C:\Users\…, which the production validation correctly rejects — the fixture path cannot double as a Linux absolute path on Windows. There is no product defect; the tests are not portable.

Prepared fix (fork branch, per the collaborators-only PR policy)

test/windows-wsl-path-portability (single commit) in https://github.com/Ralle1976/minimax-code/tree/test/windows-wsl-path-portability

describe.skipIf(process.platform === "win32") with a comment explaining the fixture constraint — the same platform-gating precedent already used by config-file-permissions.test.ts, session-diff-fallback.test.ts, update-application.test.ts and others.

Verified: the suite is skipped on Windows (12 failures gone, file still registered in test/vitest-suites.json); full pnpm test:capabilities improves 26 → 13 failures with no new failures. POSIX runs are unchanged by construction (skipIf is inert there) but were not executed locally.

Remaining Windows capability-gate baseline (context for #238)

After both fixes, pnpm test:capabilities on this machine: 4213 pass / 13 fail / 80 skip. The remaining 13:

  • 11 × symlink EPERM (canonical-agent-config 6, agent.repository 3, mcp/project-config 1, headless-invocation 1): fs.symlink on Windows needs Developer Mode/admin. As a CI-reliability option, detecting the missing privilege and reporting an explicit environment SKIP would separate "cannot run here" from "regression".
  • 2 × observability.test.ts: logging assertion mismatches; not yet root-caused.

Related gates: test:policy fails ~15 cases in local-permission-facade.test.ts because the POSIX rm → mavis-trash rewrite expectations do not hold on Windows (deny instead of allow+rewrite); test:sandbox fails 1 case in srt-macos.test.ts because that darwin suite runs unfiltered on Windows and asserts /tmp/... while the host renders \tmp\.... typecheck, check:source, check:tsconfig, build, test:smoke, test:byok, test:status-contract all pass.

Earlier community baselines (#249, #237) reported "11 locale + 12 symlink EPERM"; the zh-CN locale failures no longer reproduce on this machine.

Before submitting

  • I have searched existing issues.
  • I have included my version and removed sensitive information.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions