bun test runs every package in one process. mail-watch's test set
MAGPIE_CONFIG_DIR to its temp dir at module level and never restored it,
so page-usage-board's spawned service inherited it through ...process.env.
MAGPIE_CONFIG_DIR wins over the cwd probe, and "config dir: the host cwd
carrying magpie markers wins" read /tmp/mail-watch-test-*/usage.jsonl on
CI, which kept every publish run red after #844.
mail-watch's afterAll now restores the variable. page-usage-board's test
spawns build their env without an inherited MAGPIE_CONFIG_DIR or
USAGE_JSONL.
Run:
- On main (545ed66), mote: `bun test packages/mail-watch
packages/page-usage-board` failed this one test (79 pass, 1 fail).
- With the fix, WSL Ubuntu 24.04: full-repo `HOME=$(mktemp -d) bun test`,
as in CI, gave 7835 pass and 0 fail.
Not tried: the full repo on macOS. mote's suite lock was queued for hours.
Supersedes #921, which chdir'd the child and left the env as it was.