Skip to content

test: run every test file against a throwaway home - #62

Merged
volod-vana merged 1 commit into
mainfrom
volod/test-home-isolation
Sep 25, 2026
Merged

volod-vana merged 1 commit into
mainfrom
volod/test-home-isolation

Conversation

@volod-vana

Copy link
Copy Markdown
Member

The in-process runtime tests run fake connectors that "collect" and write results through getSourceResultPath, and nothing isolated the CLI folder. Every pnpm test on a developer machine wrote those fixtures into the real ~/.vana/results: on 2026-09-25 Volod's real GitHub and Oura exports were replaced with 17-70 byte stubs (user "tester", 0 repos), all stamped 13:04:16 PDT, the time of a test run. CI homes are throwaway, so CI never noticed.

Fix: test/setup/isolate-home.ts (vitest setupFiles) points HOME and USERPROFILE at a fresh temp dir for each test file and clears VANA_HOME. os.homedir() follows HOME, so ~/.vana, ~/.claude/skills and the rest land there. Tests that set their own HOME (the auth tests) still take precedence.

Verified: pnpm validate 510 tests; the modification times of every file in the real ~/.vana/results are identical before and after a full run.

https://claude.ai/code/session_01Fcv6uEy4zcXaigzDNxeW3j

The in-process runtime tests collect through fake connectors and never
isolated the CLI folder, so every run wrote their fixtures into the real
~/.vana/results of whoever ran the suite: on 2026-09-25 they replaced a real
GitHub and Oura export on a developer machine with "tester" stubs. A setup
file now points HOME at a fresh temp dir per test file, so ~/.vana, ~/.claude
and the rest land there; tests that set their own HOME still win.

Verified: a full run leaves the real ~/.vana/results untouched.

Claude-Session: https://claude.ai/code/session_01Fcv6uEy4zcXaigzDNxeW3j
@volod-vana
volod-vana merged commit edc5df8 into main Sep 25, 2026
6 checks passed
@github-actions

Copy link
Copy Markdown
Contributor

🎉 This PR is included in version 0.32.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant