Skip to content

bun test fails on a plain Windows machine for platform reasons, not real defects #167

Description

@SandroHub013

Description

bun test in packages/nikcli reports 7 failures on a normal Windows dev machine, none of which are real defects in the code under test:

(fail) Filesystem.realpathInside > rejects a symlink that points outside the root
(fail) Filesystem.realpathInside > rejects a symlink whose leaf points outside the root
(fail) Filesystem.realpathInside > allows a symlink that points inside the root
(fail) Filesystem.realpathInside > rejects a broken symlink that points outside the root
(fail) Filesystem Benchmark > contains performance > path containment check
(fail) Filesystem Benchmark > contains performance > non-contained paths
(fail) Filesystem > resolve > handles absolute paths

Plus, outside the CI-covered subsets:

(fail) cross-platform file:// URL handling > pathToFileURL roundtrips POSIX paths on POSIX (sanity)
(fail) cross-platform file:// URL handling > pathToFileURL handles spaces and unicode
(fail) GlobTool > finds nested matches with ** patterns

Causes:

  • The symlink cases call fs.symlink, which needs Developer Mode or an elevated shell on Windows and otherwise fails EPERM. GitHub's windows-latest runner is elevated, so CI never sees this.
  • Filesystem.resolve("/absolute/path") correctly answers C:\absolute\path on Windows; the test compares against a POSIX literal.
  • fileURLToPath only accepts paths its own platform considers absolute, so /home/user/foo.txt throws on Windows.
  • GlobTool reports native paths, so the nested match reads nested\d.ts.
  • path.win32.relative resolves both operands against the current drive, so 100k containment checks take ~1.7s against a 1000ms budget calibrated on POSIX.

Net effect: a Windows contributor cannot tell a real regression from platform noise.

Fix in #171.

Nikcli version

live-main @ 2c59e93

Steps to reproduce

  1. On Windows without Developer Mode, clean clone of live-main, bun install.
  2. cd packages/nikcli
  3. bun test test/util test/config test/worktree test/tui/util/double-esc.test.ts — 7 failures.
  4. bun test test/cross-platform.test.ts test/tool/glob.test.ts — 3 more.

Operating System

Windows 11 x64

Terminal

Windows Terminal

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

    bugSomething isn't working

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions