Skip to content

fix: make Windows unit and integration test suites pass under test:pr - #342

Merged
LadyBluenotes merged 2 commits into
mainfrom
fix/windows-test-pr
Oct 19, 2026
Merged

LadyBluenotes merged 2 commits into
mainfrom
fix/windows-test-pr

Conversation

@LadyBluenotes

Copy link
Copy Markdown
Member

🎯 Changes

  • In withNativeCompiler (packages/intent/src/validate/blocks.ts), typescript/unstable/async's Client.connectViaSpawn spawns tsgo without a cwd option (inheriting the parent's process.cwd()) while passing --cwd <root> on the command line, and api.close() closes stdin without waiting for the child process to exit. Temporarily switching process.cwd() to dirname(root) across the initial api.updateSnapshot call keeps tsgo from holding an OS directory handle on root on Windows so callers can rmSync(root) immediately after api.close().
  • In packages/intent/vitest.config.ts, set GIT_CEILING_DIRECTORIES to tmpdir() (so non-git temp fixtures do not walk up into an ancestor .git directory during git apply), TERM: 'xterm-256color' (so @clack/prompts enables Unicode symbols before module-load evaluation on Windows), and prepend C:\Program Files\Git\bin to PATH when present on Windows (so bash resolves to Git Bash rather than WSL C:\Windows\System32\bash.exe).
  • In reusable-workflows.test.ts and review-workflow.test.ts, join PATH entries with path.delimiter, use #!/usr/bin/env node instead of #!${process.execPath} (which contains spaces and backslashes on Windows), and pass pathToFileURL(preload).href to node --import.
  • In tests/integration/scaffold.ts, spawn process.execPath with node_modules/verdaccio/bin/verdaccio directly instead of cmd.exe /c verdaccio (shell: true) so registry.stop() terminates the Verdaccio Node process directly and awaits 'close' before removing storageDir. Raise beforeAll timeout in load-integration.test.ts and scanner-integration.test.ts to 60_000 ms to match the test cases, and use execSync for npm pack in packed-release.test.ts.
  • Adds a patch changeset.

✅ Checklist

  • I have followed the steps in the Contributing guide.
  • I have tested this code locally with pnpm run test:pr (run pnpm build:all first).

🚀 Release Impact

  • This change affects published code, and I have generated a changeset.
  • This change is docs/CI/dev-only (no release).

- Spawn TypeScript 7 tsgo from dirname(root) during the initial
  updateSnapshot in withNativeCompiler while keeping --cwd set to root,
  so Windows does not lock root while tsgo closes its stdio pipe after
  api.close().
- Configure GIT_CEILING_DIRECTORIES, TERM=xterm-256color, and Git for
  Windows bin PATH in packages/intent/vitest.config.ts so temporary test
  fixtures do not inherit a parent git repository or WSL bash.exe.
- Use path.delimiter, #!/usr/bin/env node, and pathToFileURL(preload) in
  reusable-workflows.test.ts and review-workflow.test.ts.
- Spawn Node directly with verdaccio/bin/verdaccio and await process
  close before deleting storageDir in integration tests, and invoke npm
  pack via execSync in packed-release.test.ts.
@changeset-bot

changeset-bot Bot commented Oct 19, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: d882106

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@tanstack/intent Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@coderabbitai

coderabbitai Bot commented Oct 19, 2026

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Note

Currently processing new changes in this PR. This may take a few minutes, please wait...

⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: be950b40-d7ae-4dae-8be9-b1d4ac9fd339
📥 Commits

Reviewing files that changed from the base of the PR and between 1ff7b0f and bfd25ea.

📒 Files selected for processing: 9
  • .changeset/windows-tsgo-close-wait.md
  • packages/intent/src/validate/blocks.ts
  • packages/intent/tests/integration/load-integration.test.ts
  • packages/intent/tests/integration/packed-release.test.ts
  • packages/intent/tests/integration/scaffold.ts
  • packages/intent/tests/integration/scanner-integration.test.ts
  • packages/intent/tests/reusable-workflows.test.ts
  • packages/intent/tests/review-workflow.test.ts
  • packages/intent/vitest.config.ts
+------------------------------------------+
| Your favorite GPT-wrapped code reviewer. |
+------------------------------------------+
  \
   \     /)/)
        ( '')
        /  |
      o(___)
✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@nx-cloud

nx-cloud Bot commented Oct 19, 2026 •

Copy link
Copy Markdown

View your CI Pipeline Execution ↗ for commit bfd25ea

Command Status Duration Result
nx affected --targets=test:eslint,test:sherif,t... ✅ Succeeded 1m 2s View ↗
nx run-many --targets=build ✅ Succeeded 1s View ↗

☁️ Nx Cloud last updated this comment at 2026-10-19 01:16:23 UTC

@pkg-pr-new

pkg-pr-new Bot commented Oct 19, 2026

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/@tanstack/intent@342

commit: bfd25ea

@LadyBluenotes
LadyBluenotes merged commit 9400b3e into main Oct 19, 2026
7 checks passed
@LadyBluenotes
LadyBluenotes deleted the fix/windows-test-pr branch October 19, 2026 01:15
@github-actions github-actions Bot mentioned this pull request Oct 19, 2026
@codspeed

codspeed Bot commented Oct 19, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

⚠️ 7 benchmarks spent significant time in system calls

System calls cannot be consistently instrumented, so they are not included in the measure, which understates the real cost. Please switch to the Walltime instrument to accurately measure system calls.

Measurement and system calls

ℹ️ 7 benchmarks have no flame graph

The flamegraph could not be generated because too much time was spent in runtime internals, making the visualization not useful for performance analysis.

✅ 12 untouched benchmarks


Comparing fix/windows-test-pr (d882106) with main (1ff7b0f)

Open in CodSpeed

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.

1 participant