Skip to content

fix: give fallback-path tests a workspace with no project ancestry - #28

Merged
Shinrai merged 3 commits into
nextfrom
fix/test-fixture-leak
Aug 18, 2026
Merged

fix: give fallback-path tests a workspace with no project ancestry#28
Shinrai merged 3 commits into
nextfrom
fix/test-fixture-leak

Conversation

@cldmv-bot

@cldmv-bot cldmv-bot Bot commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

🚀 What's Changed

💥 Breaking Changes

No breaking changes

✨ Features

No new features

🐛 Bug Fixes

📦 Dependencies

No dependency updates

🔧 Other Changes

👥 Contributors

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.
@cldmv-bot cldmv-bot Bot added ! fix → next v4 flow: fix contributor PR targeting the next integration branch area: tests Touches test files, fixtures, or test infrastructure labels Aug 11, 2026
…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.
@cldmv-bot cldmv-bot Bot changed the title test(fixtures): keep fixtures in repo tmp/ + age-based orphan reaper fix: give fallback-path tests a workspace with no project ancestry Aug 18, 2026
@cldmv-bot

cldmv-bot Bot commented Aug 18, 2026

Copy link
Copy Markdown
Contributor Author

Auto-normalized PR title: rewrote PR title to match the highest-priority commit type (fix).

  • Before: test(fixtures): keep fixtures in repo tmp/ + age-based orphan reaper
  • After: fix: give fallback-path tests a workspace with no project ancestry

If this isn't what you want, edit the title — the normalizer won't re-fire as long as the title stays conventional.

@Shinrai
Shinrai requested a lite review from Copilot August 18, 2026 21:57
Shinrai
Shinrai previously approved these changes Aug 18, 2026

This comment was marked as resolved.

…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.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 5 out of 5 changed files in this pull request and generated no new comments.

@Shinrai
Shinrai merged commit 70251a0 into next Aug 18, 2026
25 checks passed
@cldmv-bot
cldmv-bot Bot deleted the fix/test-fixture-leak branch August 18, 2026 23:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: tests Touches test files, fixtures, or test infrastructure ! fix → next v4 flow: fix contributor PR targeting the next integration branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants