Repository navigation
test(service): expect the env-indirect Bun path in Windows preflight wrappers - #6852
Conversation
…wrappers The Windows shim and service-script generators write a Bun that lives under the user profile as a %LOCALAPPDATA%/%USERPROFILE% token (src/lib/win-paths.ts), but three preflight assertions expected the literal process.execPath. They passed on CI, whose Bun sits in the tool cache, and failed on any Windows machine with Bun in the default profile location. The assertions now expect the complete `set "OCX_BUN=..."` line rendered the way the generators render it.
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
✅ Deterministic PR hygiene checks passed. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configuration
📒 Files selected for processing (2)
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 7 remain after this review. 📝 WalkthroughWalkthroughThe Windows runtime preflight tests now expect batch-escaped runtime paths in shim wrappers and scheduler scripts. They use ChangesWindows runtime preflight tests
Priority: ⬇️ Low Estimated code review effort: 2 (Simple) | ~8 minutes Change: Other Merge Risk: ⚪ Minimal · up to The Windows preflight assertions now match the shim and scheduler output for profile-based, batch-escaped runtime paths. No actionable merge-blocking risk remains. Pre-merge checks |
|
…#6855) * docs(devlog): record the cross-OS probe of the desktop-owned CLI path Plan, per-host execution notes and outcomes for probing #6802, #6807, #6809, #6812, #6816 and #6818 on Ubuntu 24.04 and Windows 11. Follow-ups: #6851, #6852, #6853, #6854. * docs(devlog): tighten evidence citations and the F1 hypothesis * docs(devlog): qualify unretained evidence in the probe outcome * docs(devlog): record exact-head CI for the probe follow-ups * docs(devlog): close the cross-OS probe unit and fold review fixes * docs(devlog): align the P2 escape note and guard the probe cleanup paths
Summary
Three #6812 preflight tests fail on a normal Windows development machine and pass in CI:
Windows shim selected-runtime preflight > fresh install admits once before the first move and freezes all wrapper renderingWindows shim selected-runtime preflight > automatic refresh bakes the frozen admitted path/source after selection changesservice selected-runtime admission > scheduler composed install never admits again after stopThey assert that the generated
.cmdcontains the literalprocess.execPath. Both generators deliberately write a path under the user profile as a%LOCALAPPDATA%/%USERPROFILE%token (windowsEnvIndirectBatchValueinsrc/lib/win-paths.ts, used bysrc/codex/shim-templates.tsandsrc/service/windows-taskxml.ts) so non-ASCII profile names survive the OEM code page. CI's Bun lives in the tool cache, outside the profile, so the literal and the rendered form coincide there; with Bun under%USERPROFILE%\.bunor a checkout under%LOCALAPPDATA%they differ, e.g.set "OCX_BUN=%LOCALAPPDATA%\Temp\…\node_modules\bun\bin\bun.exe".The assertions now expect the complete
set "OCX_BUN=…"line rendered the way the generators render it (same env-token prefix and the same%/^/"suffix escaping). On macOS, Linux and CI the expected line still contains the literal path; the frozen-runtime andunprobed.exechecks are unchanged. Test-only change. (The CodeRabbit summary below overstates the coverage: the tests useprocess.execPath, and no fixture contains%,^or"; the escaping is mirrored so such a path would also match, but it is not exercised.)Verification
mini, pinned Bun 1.4.2 under%LOCALAPPDATA%, currentdevclone, isolatedOPENCODEX_HOME/CODEX_HOME):bun test tests/codex-integration/codex-shim-runtime-preflight.test.ts tests/service/service-runtime-preflight.test.ts→ before 28 pass / 3 fail (the three tests above); with this PR 31 pass / 0 fail, twice.bun run typecheckclean.bun run testsuite — the change is confined to three assertions in two test files. Ordinary PR CI skips the Windows shards, so theminirun is the Windows evidence.Checklist
Summary by CodeRabbit