Skip to content

test(repos): repos and branches tests use git fake - #2921

Merged
dan-petty merged 2 commits into
mainfrom
test/2183-repos-branches-tests-reach-git-fake
Oct 31, 2026
Merged

dan-petty merged 2 commits into
mainfrom
test/2183-repos-branches-tests-reach-git-fake

Conversation

@dan-petty

Copy link
Copy Markdown
Owner

Summary

Migrate the repos, branches, github, ssh, devcontainer, tf, and openspec test suites to reach git through the git fake of #2146.

Zero tests start git subprocesses during execution, verified through a PEP 578 audit hook on subprocess.Popen.

Acceptance Criteria

  • No test in the 10 files starts git or another program. The hermetic audit hook verifies 0 git subprocess calls during test runs.
  • 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 internal devops_cli name for git operations.
  • Each test checks the behavior it checked before. No tests were deleted.
  • Summed runtime of the 10 test files before and after (uv run pytest <files> -n 0 --durations=0):
    • Before: 404 passed in 25.36s (36.12s total session time)
    • After: 404 passed in 21.04s
  • All fast static checks pass (devops ci lint, devops ci format --check, devops ci typecheck).

Closes #2183

Migrate the repos, branches, github, ssh, devcontainer, tf, and
openspec test suites to reach git through the git fake.

- Replace real git subprocesses with in-process GitFake and ProcessFake.
- Construct worktree and repo metadata in Python under temporary paths.
- Remove internal devops_cli patches for git subprocesses.
- Verify 0 git subprocess starts across all 10 migrated test files.
- Test durations across the 10 files improved from 25.36s (36.12s total)
  to 21.04s.

Closes #2183
@dan-petty dan-petty added type/test Type test: a new or changed test scope/repos The devops repos commands and worktrees labels Oct 31, 2026
Set usedforsecurity=False on test sha1 calls in test_repos_worktrees.py
to satisfy bandit security analysis rules.
@dan-petty
dan-petty marked this pull request as ready for review October 31, 2026 20:32
@dan-petty
dan-petty merged commit a5f3f38 into main Oct 31, 2026
18 checks passed
@dan-petty
dan-petty deleted the test/2183-repos-branches-tests-reach-git-fake branch October 31, 2026 20:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

scope/repos The devops repos commands and worktrees type/test Type test: a new or changed test

Projects

None yet

Development

Successfully merging this pull request may close these issues.

test(repos): the repos, branches, github, ssh, devcontainer, tf and openspec tests start no git and reach git through the git fake

1 participant