Repository navigation
Description
What happened
#2143 records the owner's rule of 2026-10-24: a test of src/ starts no program. The data directory, run store and gitignore tests still start a real git. The test-suite audit of 2026-10-24 at df8e2ee recorded every program a test started, with a PEP 578 audit hook on subprocess.Popen. It saw 142 tests in these files start git:
| File | Tests that started git |
|---|---|
tests/test_data_dir_worktrees.py |
88 |
tests/test_gitignore_evaluation.py |
22 |
tests/test_run_store.py |
18 |
tests/test_run_comparison.py |
14 |
Most of them build a repository under tmp_path with a git helper or fixture, and the code under test then starts git through the process runner. A test that starts only git has a median time of 0.194 s, against 0.026 s for a test that starts nothing (the audit's cost summary).
What should happen
These tests reach git through the git fake of #2146 and start no program. A helper that builds a repository with git goes: the test writes its files under tmp_path and states the git answers it needs. A test that needs an answer that #2146 did not record adds the transcript with the recording row of #2146.
Evidence
.data/agent/scratch/audit/full_list.txtof the 2026-10-24 audit, section 1.git.
At b170358:
tests/test_data_dir_worktrees.py:46:init_repo, over the rootgitfixture (tests/conftest.py:1131).tests/test_gitignore_evaluation.py:24-26:make_reporunsgit init.tests/test_run_store.py:484:git init.
Acceptance criteria
- No test in the files above starts git or another program. The hermetic floor fails any of them that starts git, as it fails a test that starts gh.
- The tests reach git only through the fake of test(git): one git seam answers tests from recorded git transcripts, with a contract suite that replays them #2146, and patch no
devops_cliname (docs/TESTING.md). - Each test still checks the behaviour it checked before. The pull request names each test it deletes and why.
- The pull request gives the summed time of these files before and after (
uv run pytest <files> -n 0 --durations=0). -
uv run devops cipasses.
Order: after #2146. Follows ADR 0007 as #2143 amends it. Related: #1333 (the core and config tests move onto edge fakes).
Source: #2146
Proposed design
Problem statement
Four test files start 142 real git processes, violating the owner's rule that tests of src/ start no program. The data directory, run store, and gitignore tests build repositories with git helpers or fixtures, and the code under test then starts git through the process runner. A test that starts only git has a median time of 0.194 s, against 0.026 s for a test that starts nothing. These tests must reach git through the git fake of #2146 and start no program.
Acceptance criteria
- Criterion 1: No test in the four files starts git or another program. The hermetic floor fails any test that starts git.
Verification: Run the hermetic floor check on the four files. No test is reported as starting a program. - Criterion 2: The tests reach git only through the fake of test(git): one git seam answers tests from recorded git transcripts, with a contract suite that replays them #2146 and patch no devops_cli name.
Verification: Search the four test files for subprocess.run, subprocess.Popen, or monkeypatch.setattr on devops_cli names. No matches are found. - Criterion 3: Each test still checks the behaviour it checked before. The pull request names each test it deletes and why.
Verification: Review the pull request description for a list of deleted tests with reasons. Run the full test suite and confirm no regression. - Criterion 4: The pull request gives the summed time of the four files before and after.
Verification: The pull request body contains two lines of uv run pytest -n 0 --durations=0 output, one before and one after the change. - Criterion 5: uv run devops ci passes.
Verification: Run uv run devops ci on the pull request branch. All checks pass.
Key questions
- What git operations do the affected tests currently perform?: git init, git add ., git commit, git worktree add, git clone, git submodule add, and git check-ignore. The test_data_dir_worktrees.py file uses init, add, commit, worktree add, clone, and submodule add. The test_gitignore_evaluation.py file uses init and check-ignore. The test_run_store.py file uses init. [sources: tests/test_data_dir_worktrees.py:46-52, tests/test_gitignore_evaluation.py:24-26, tests/test_run_store.py:484]
- How should the tests be restructured to use the git fake?: The test writes its files under tmp_path and states the git answers it needs. A helper that builds a repository with git is replaced by file creation and a stated set of git responses. A test that needs an answer not recorded in test(git): one git seam answers tests from recorded git transcripts, with a contract suite that replays them #2146 adds the transcript with the recording row of test(git): one git seam answers tests from recorded git transcripts, with a contract suite that replays them #2146. (proposed)
- What is the git fixture that the test_data_dir_worktrees.py tests use?: A root-level fixture at tests/conftest.py:1131 that provides a callable accepting a directory and git arguments, running the git command in that directory. The init_repo fixture at tests/test_data_dir_worktrees.py:46 wraps it to create a repository with one commit. [sources: tests/conftest.py:1131, tests/test_data_dir_worktrees.py:46-52]
Fit
Fits in one pull request.
Suspected block
None.
Dependencies
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsReady
- StatusShow more project fieldsNew
Activity
dan-petty commentedon Oct 24, 2026
Intake placed this item to the backlog: intake puts every new item in the backlog. A person plans the milestones on the board.
The candidate is about test changes and behavior, not a feature or bug fix.This improves test performance and consistency but is not critical to core functionality.Improves test suite performance and reduces flakiness by using the git fake instead of real git processes.Requires rewriting tests to use the git fake, which may involve significant changes to test setup and expectations.Both items relate to tests that should start no program, but the candidate specifically asks for using the git fake while #2143 sets the general rule about starting no program.dan-petty commentedon Oct 28, 2026
Status set to Ready at bb46660 (see proposed design in issue body).
test(git): core tests start no git on fake
fix(docs): fix stale statements found by the content census (#7632)