Skip to content

fix(test): isolate tmpdir from parent git worktree in test fixtures#1256

Merged
MiMoHardFather merged 1 commit into
mainfrom
test/fix-tmpdir-git-isolation
Jun 23, 2026
Merged

fix(test): isolate tmpdir from parent git worktree in test fixtures#1256
MiMoHardFather merged 1 commit into
mainfrom
test/fix-tmpdir-git-isolation

Conversation

@MiMoHardFather

Copy link
Copy Markdown
Collaborator

Summary

  • Add outsideGit option to tmpdirScoped and withTmpdirOutsideGit helper to create tmpdirs outside the repo's git worktree
  • Fix tests that were inheriting the parent repo's .git directory, causing false positives/negatives
  • Correct tool argument casing (filePathfile_path) in scripted LLM stub responses

Changes

File Change
test/fixture/fixture.ts Add outsideGitTmpRoot(), withTmpdirOutsideGit(), and outsideGit option to tmpdirScoped/provideTmpdirInstance
test/project/migrate-global.test.ts Use withTmpdirOutsideGit for non-git project test
test/project/project.test.ts Use withTmpdirOutsideGit for non-git directory test
test/project/worktree.test.ts Pass outsideGit: true for NotGitError test
test/lsp/index.test.ts Enable git: true for LSP spawn test
test/session/instruction.test.ts Enable git: true for project tmpdir
test/session/classify-integration.test.ts Fix tool arg casing in stub responses
test/session/length-tool-safety.test.ts Fix tool arg casing + increase timeout to 30s

Add outsideGit option to tmpdirScoped and withTmpdirOutsideGit helper
to create tmpdirs outside the repo's git worktree, preventing tests
from inheriting the parent repo's .git directory.

Fix tests that require a non-git environment or explicit git init:
- migrate-global.test.ts, project.test.ts: use withTmpdirOutsideGit
- worktree.test.ts: pass outsideGit option to provideTmpdirInstance
- lsp/index.test.ts: enable git for LSP spawn test
- instruction.test.ts: enable git for project tmpdir
- classify-integration.test.ts, length-tool-safety.test.ts: fix tool
  arg casing (filePath -> file_path)
@MiMoHardFather MiMoHardFather merged commit 86d95a7 into main Jun 23, 2026
2 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant