Skip to content

ci: fix Windows CI to actually run Node.js tests#606

Merged
fansenze merged 1 commit intomainfrom
fix/windows-path-compat-20260407
Apr 8, 2026
Merged

ci: fix Windows CI to actually run Node.js tests#606
fansenze merged 1 commit intomainfrom
fix/windows-path-compat-20260407

Conversation

@fansenze
Copy link
Copy Markdown
Contributor

@fansenze fansenze commented Apr 7, 2026

Summary

Windows CI was silently skipping all Node.js tests due to multiple issues:

  • Remove single quotes from pnpm --filter in build/test scripts — cmd.exe does not strip single quotes, causing filters to match zero projects
  • Fix CLI test helpers: use spawn(process.execPath, [bin, ...args]) instead of spawn(bin, args) — Windows cannot directly execute .cjs files (no shebang support)
  • Fix basic.test.ts: replace \r\n in test filename (forbidden on NTFS) with %, which are NTFS-safe but still test URL encoding
  • Fix args.test.ts: use path.resolve() for expected values instead of hardcoded Unix paths
  • Fix config-discovery.test.ts: replace hardcoded /project/... paths with cross-platform paths using path.resolve + path.join
  • Fix type-check-snapshot normalizeOutput: handle Windows absolute paths and 8.3 short name relative paths in snapshot normalization

Related Links

Checklist

  • Tests updated (or not required).
  • Documentation updated (or not required).

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates the package.json build and test scripts by removing quotes from pnpm filter patterns. Additionally, it refactors the test suites in args.test.ts and config-discovery.test.ts to use platform-appropriate absolute paths via a new helper function and path.resolve. These changes improve the cross-platform compatibility of the tests, particularly on Windows and macOS. I have no feedback to provide as there were no review comments to assess.

@fansenze fansenze force-pushed the fix/windows-path-compat-20260407 branch from f42424c to 5fce749 Compare April 7, 2026 07:41
@fansenze fansenze changed the title fix: make pnpm filter and tests work on Windows ci: fix Windows CI to actually run Node.js tests Apr 7, 2026
@fansenze fansenze force-pushed the fix/windows-path-compat-20260407 branch 20 times, most recently from 7357c30 to dcdddc3 Compare April 8, 2026 09:40
Test infrastructure fixes:
- Fix CLI test helpers: use spawn(process.execPath, [bin, ...args])
  instead of spawn(bin, args) (Windows has no shebang support for .cjs)
- Fix basic.test.ts: replace \r\n in filename (forbidden on NTFS)
- Fix args.test.ts: use path.resolve() instead of hardcoded Unix paths
- Fix config-discovery.test.ts: use cross-platform paths
- Fix type-check snapshot normalizeOutput: handle Windows absolute paths
  and 8.3 short name relative paths

Windows path matching fixes:
- buildProgramFileSet: add Realpath'd key alongside original so lookups
  from filepath.EvalSymlinks match even when os.Getwd() returns 8.3
  short names (Windows) or unresolved symlinks (macOS)
- cmd.go: store both pre/post EvalSymlinks paths in allowDirs so dir
  scoping works with either path format
@fansenze fansenze force-pushed the fix/windows-path-compat-20260407 branch from dcdddc3 to c8d96b8 Compare April 8, 2026 10:53
@fansenze fansenze enabled auto-merge (squash) April 8, 2026 11:11
@fansenze fansenze merged commit a773538 into main Apr 8, 2026
10 checks passed
@fansenze fansenze deleted the fix/windows-path-compat-20260407 branch April 8, 2026 11:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants