Repository navigation
test: every test gets its own HOME, so none write the real ~/.cache - #298
Merged
Merged
Conversation
tests/helpers.bash now points HOME at the test's BATS_TEST_TMPDIR (with a .gitconfig carrying the test identity) and unsets the XDG dirs. Tests that kept the real HOME wrote the CLI's caches into the operator's ~/.cache/found-issues (mode_foo_bar rewritten during a suite run, measured 2026-10-29) and shared them with tests running beside them. tests/test-isolation.bats: HOME is per test, a real mode-cache write lands in it and not in the account's home, commits work without fi_init_git. Red before the change (the leak file appeared in the real cache), green after. Full parallel suite: 2058 tests, no file in the real ~/.cache/found-issues written during the run. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01MVx3HWniZnrXYfPiCo5Lrs
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01MVx3HWniZnrXYfPiCo5Lrs
AltDoug
enabled auto-merge (squash)
October 30, 2026 04:32
AltDoug
added a commit
that referenced
this pull request
Oct 30, 2026
Claude-Session: https://claude.ai/code/session_01MVx3HWniZnrXYfPiCo5Lrs Co-authored-by: Diogo Silva Sena <227921880+DougBTW@users.noreply.github.com> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
tests/helpers.bash:HOMEis the test's own$BATS_TEST_TMPDIR/home, with a.gitconfigholding the test identity;XDG_CACHE_HOME/XDG_CONFIG_HOME/XDG_DATA_HOME/XDG_STATE_HOMEare unset. Tests that set their own HOME are unchanged.tests/test-isolation.bats(3 tests). README test count 2055 → 2058.Why
Ledger
tests/helpers.bash:25: tests that kept the real HOME wrote the CLI's caches into the operator's~/.cache/found-issues. Measured 2026-10-29:mode_foo_bar(a fixture slug) was rewritten during a suite run. Underbats --jobsthose files were also shared between tests running at the same time.Evidence
tests/test-isolation.batsred before the change: HOME was the real home, and the mode-cache file landed in the real~/.cache(the test's teardown removed it). Green after.bats --jobs 14 tests/:1..2058, 2057 ok, 1 not ok = the README count check, then fixed (tests/docs-consistency.bats+ isolation: 17/17).~/.cache/found-issueswas newer than a marker touched just before the full run.🤖 Generated with Claude Code
https://claude.ai/code/session_01MVx3HWniZnrXYfPiCo5Lrs