fix(test): point USERPROFILE at the temp home on Windows - #1261
fix(test): point USERPROFILE at the temp home on Windows#1261anhtahaylove wants to merge 1 commit into
Conversation
`os.homedir()` reads USERPROFILE on Windows and ignores HOME, so these two tests read the developer's real ~/.agentmemory/.env instead of the temp one they wrote. Anyone whose own .env sets AGENTMEMORY_SLOTS or AGENTMEMORY_REFLECT to false fails them; CI passes because HOME and USERPROFILE agree on Linux. Sets both, and restores both afterwards. Signed-off-by: anhtahaylove <everest.kill1@gmail.com>
|
@anhtahaylove is attempting to deploy a commit to the rohitg00's projects Team on Vercel. A member of the Team first needs to authorize it. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
Included review availability: Your plan provides up to 10 included reviews per hour; 7 remain after this review. 📝 WalkthroughWalkthroughThe test setup now controls both ChangesCross-platform test isolation
Estimated code review effort: 2 (Simple) | ~10 minutes Merge Risk: ⚪ Minimal · up to This change makes the Windows tests use the temporary home directory consistently; no actionable merge-blocking risk remains after normal checks and review. 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
Full details: Docstring CoverageExplanation No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 1 files. ✨ Finishing Touches 💡 1🛠️ Fix failing CI checks 💡
🧪 Generate unit tests (beta)
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. Comment |
|
Context for this one: #1264 audits the whole Windows test picture — 30 failures, what causes each group, and which PR covers it. |
Two tests in
test/slots-flag-gate.test.tsfail on Windows for anyone whose own~/.agentmemory/.envsetsAGENTMEMORY_SLOTSorAGENTMEMORY_REFLECTtofalse.Cause
beforeEachcreates a temp home and pointsHOMEat it, butsrc/functions/slots.jsresolves the config path throughos.homedir()— and on Windows that readsUSERPROFILE, ignoringHOMEentirely:So the flag is read from the developer's real
.envrather than the temp file the test just wrote. CI is green becauseHOMEandUSERPROFILEagree on Linux.Fix
Set
USERPROFILEalongsideHOMEin bothdescribeblocks and restore it inafterEach.Verification
On a clean checkout of
main, Windows:slots-flag-gateis the only test file that overridesHOMEwithoutUSERPROFILE— the other nine already set both, so this brings it in line with them.Summary by CodeRabbit