# test: resolve the Windows temp directory to its long name · PR \#9573 · pingdotgg/t3code

[View on GitCafe](https://git.cafe/pingdotgg/t3code/pull/9573)

Repository: [pingdotgg/t3code](https://git.cafe/pingdotgg/t3code)

Visibility: public

State: merged

Source repository: pingdotgg/t3code

Source branch: windows-tests/short-tempdir

Target branch: windows-tests/temp-cleanup

Head commit: 5032af7a8437942c058182d017f5884641e5f8c4

[Discussion and reviews](https://git.cafe/pingdotgg/t3code/pull/9573)

[Commits](https://git.cafe/pingdotgg/t3code/pull/9573/commits?format=markdown)

[Files changed](https://git.cafe/pingdotgg/t3code/pull/9573/diffs?format=markdown)

## Description

---

GitHub's Windows runners set TEMP to the 8.3 short form
(C:\Users\RUNNER~1\...), and every path that goes through git or realpath
comes back in the long form, so equality checks between a temp directory and
its canonical form fail. A shared setup file, run by every package's vitest
config, points TEMP/TMP at the long form once so os.tmpdir() and everything
built on it agree with the canonical spelling.

bootstrap.test opens the platform null device instead of /dev/null and skips
the FIFO case, since Windows has neither.

Part of the Windows test-suite stack rooted at [#9564](https://github.com/pingdotgg/t3code/pull/9564); the manual Windows lane comes from [#9538](https://github.com/pingdotgg/t3code/pull/9538).

Model: Claude Fable 5 in Claude Code.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

<!-- Macroscope's pull request summary starts here -->
<!-- Macroscope will only edit the content between these invisible markers, and the markers themselves will not be visible in the GitHub rendered markdown. -->
<!-- If you delete either of the start / end markers from your PR's description, Macroscope will append its summary at the bottom of the description. -->
> [!NOTE]
> ### Resolve Windows temp directory to long name in test setup
> - Adds [longTempDir.ts](https://github.com/pingdotgg/t3code/pull/9573/files#diff-9f11225c87968c5b3c1e7d62db9cd4fb9df489c517208e7c5889d4f7ff6f9c36), which on win32 resolves the canonical long form of the temp directory and assigns it to `TEMP` and `TMP`; non-Windows hosts and resolution failures are left unchanged
> - Wires this setup module into the root, desktop, web, and client-runtime Vite test configs via an absolute path or package subpath export in [package.json](https://github.com/pingdotgg/t3code/pull/9573/files#diff-3752b1e4e3e2032593e21e9268ec0379680a59e4e7b8517d0d5492a71530d3e8)
> - Updates [bootstrap.test.ts](https://github.com/pingdotgg/t3code/pull/9573/files#diff-0ce606ba1b9ab11f436ea374b47d8760acc9ca02c427343b8690bdc8c52a2175) to select the platform-specific null device (`NUL` vs `/dev/null`) and skips the FIFO timeout test on Windows
> - Behavioral Change: Windows test runs now see long-form `TEMP`/`TMP` paths; if resolution fails the environment is untouched
>
> <!-- Macroscope's review summary starts here -->
>
> <sup><a href="https://app.macroscope.com">Macroscope</a> summarized 5032af7.</sup>
> <!-- Macroscope's review summary ends here -->
>
<!-- Macroscope's pull request summary ends here -->

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> **Low Risk**
> Test-only environment and platform-guard changes; production runtime behavior is unchanged aside from optional Vitest setup on Windows.
> 
> **Overview**
> Adds shared Vitest setup **`longTempDir.ts`** that on **win32** rewrites **`TEMP`** and **`TMP`** to the canonical long path from **`realpathSync`**, so **`os.tmpdir()`** matches git/realpath spelling on GitHub Windows runners (8.3 short names). The module is exported from **`@t3tools/shared`** and registered in the root, desktop, web, and client-runtime Vite test configs (server inherits it via **`mergeConfig`** with its existing git setup).
> 
> **`bootstrap.test.ts`** uses **`NUL`** vs **`/dev/null`** for null-device FD tests and **`skipIf(windowsHost)`** on the FIFO timeout case because Windows lacks **`mkfifo`**.
> 
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit 5032af7a8437942c058182d017f5884641e5f8c4. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->


