Skip to content

test(git): core tests start no git on fake - #2890

Merged
dan-petty merged 1 commit into
mainfrom
test/2174-core-tests-reach-git-fake
Oct 31, 2026
Merged

dan-petty merged 1 commit into
mainfrom
test/2174-core-tests-reach-git-fake

Conversation

@dan-petty

Copy link
Copy Markdown
Owner

Description

This pull request migrates four test files to reach git through the git_fake process runner seam, ensuring no test starts a real git subprocess.

  • Migrated tests/core/test_data_dir_worktrees.py away from real git subprocess calls to in-memory filesystem layouts and scripted git_fake responses.
  • Migrated tests/core/test_gitignore_evaluation.py to evaluate ignore patterns directly without git init or git check-ignore.
  • Migrated tests/ai/test_run_store.py to directory creation and scripted git answers.
  • Added _setup_git_fake in tests/ai/test_run_comparison.py for source commit inspection queries.
  • Archived OpenSpec change 2174-core-tests-reach-git-fake.

Verification

  • Execution duration across all 162 tests decreased from 13.86s to 11.48s (~17% faster).
  • Verified zero real git processes start with hermetic git tripwire refusal.
  • Verified all quality gates pass via uv run devops ci run.

Closes #2174

@dan-petty dan-petty added the type/test Type test: a new or changed test label Oct 31, 2026
@dan-petty dan-petty changed the title test(core): core tests start no git on fake test(git): core tests start no git on fake Oct 31, 2026
Migrate four core and AI test suites to reach git through the
`git_fake` process runner seam instead of starting real git
subprocesses.

- Replace real git repositories in `tests/core/test_data_dir_worktrees.py`
  with in-memory filesystem structures and scripted `GitFake` responses.
- Replace git initialization and `git check-ignore` subprocess calls in
  `tests/core/test_gitignore_evaluation.py` with path evaluations.
- Migrate `tests/ai/test_run_store.py` to directory creation and
  scripted git answers.
- Add git fake fixture to `tests/ai/test_run_comparison.py` to answer
  source commit rev-parse queries.
- Reduce test duration from 13.86s to 11.48s across all 162 tests.
- Archive OpenSpec change `2174-core-tests-reach-git-fake`.

Closes #2174
@dan-petty
dan-petty force-pushed the test/2174-core-tests-reach-git-fake branch from 55ae200 to 8432c13 Compare October 31, 2026 17:04
@dan-petty
dan-petty marked this pull request as ready for review October 31, 2026 17:10
@dan-petty
dan-petty merged commit 1bb907f into main Oct 31, 2026
18 checks passed
@dan-petty
dan-petty deleted the test/2174-core-tests-reach-git-fake branch October 31, 2026 17:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type/test Type test: a new or changed test

Projects

None yet

Development

Successfully merging this pull request may close these issues.

test(core): the data directory, run store and gitignore tests start no git and reach git through the git fake

1 participant