fix: give fallback-path tests a workspace with no project ancestry - #28
Merged
Conversation
Test fixtures were written to <cwd>/../tmp-fix-headers-tests (the repos root) and only cleaned on the happy path, so failed/interrupted runs leaked git-repo fixtures into the shared repos root — hundreds accumulated. Anchor the fixture root to the repo's own gitignored tmp/ (import.meta.dirname-relative, cwd-independent), and add a vitest globalSetup that reaps only STALE (mtime older than 1h) orphans so a concurrent in-flight run's fresh fixtures are never touched.
…stry Anchoring FIXTURE_ROOT under this repo's own tmp/ (to stop leaked fixtures sprawling into the shared repos root) means every fixture now sits under this repo's own package.json and .git. That breaks the two tests that assert the "nothing detected" fallback path: unknown project language now resolves to "node" (finds this repo's package.json walking up), and unknown git author now resolves to the real local identity (finds this repo's .git config, which GIT_CONFIG_GLOBAL/HOME overrides can't touch since those only affect the global scope, not a discovered local repo). Add createIsolatedWorkspace(), using the OS temp directory instead of FIXTURE_ROOT, for the two tests that need genuinely zero project ancestry. Everything else keeps using createWorkspace() (in-repo tmp/, leak-contained, age-reaped) since it doesn't care about ancestor isolation.
Contributor
Author
|
Auto-normalized PR title: rewrote PR title to match the highest-priority commit type (
If this isn't what you want, edit the title — the normalizer won't re-fire as long as the title stays conventional. |
Shinrai
previously approved these changes
Aug 18, 2026
…tale comment reapStaleWorkspaces() requested withFileTypes but never checked isDirectory() before reaping an entry, so any unexpected non-directory file under FIXTURE_ROOT would also get swept up. Filter to directories only. Also correct vitest.config.mjs's globalSetup comment, which said the setup "wipes" the fixture root before/after the run — it only reaps STALE (age- guarded) directories, never a whole-root wipe. Addresses review comments on PR #28.
Shinrai
approved these changes
Aug 18, 2026
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's Changed
💥 Breaking Changes
No breaking changes
✨ Features
No new features
🐛 Bug Fixes
📦 Dependencies
No dependency updates
🔧 Other Changes
👥 Contributors