Documentation
¶
Overview ¶
Package testenv isolates a test binary from the developer's own machine state. It is a non-test package so any package's TestMain can import it.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsolateHome ¶
func IsolateHome() (cleanup func(), err error)
IsolateHome points the process at a throwaway home directory and returns a cleanup function. Call it from TestMain, before m.Run.
Without it, any test that reaches workspace.GlobalContextStorePath writes to the developer's real ~/.mivia/context.db - which is how one real store accumulated 57,077 distinct workspace ids and 70,841 worktree instance rows against a handful of genuine worktrees. Test rows in a user's durable store are not only noise: they are indistinguishable from real sessions, so no retention sweep can safely tell them apart afterwards.
The returned cleanup restores the previous environment and removes the temporary directory. It is safe to call more than once.
Types ¶
This section is empty.