Skip to content

test(tests): core tests run on the process and GitHub fakes - #3863

Merged
dan-petty merged 4 commits into
mainfrom
test/1333-core-tests-on-edge-fakes
Nov 6, 2026
Merged

dan-petty merged 4 commits into
mainfrom
test/1333-core-tests-on-edge-fakes

Conversation

@dan-petty

Copy link
Copy Markdown
Owner

The tests of core/process.py now use the shared fakes. They no longer patch run_subprocess and no longer read or assign a private name of the GitHub identity.

  • The tests of the JSON runner answer the child through process_fake.
  • The tests of the GitHub identity use reset_github_token, the token of pin_github_session, the clock fixture and process_fake.
  • _session_github_token reads clock.monotonic() of the clock seam, so a test can move the retry interval of a failed lookup without a private assignment. The behavior does not change.
  • The tests of the child environment keep the stdlib subprocess.run double. They test DefaultProcessRunner, which process_fake replaces. ADR 0007 allows a double at a stdlib edge.

Closes #3860

Change: openspec/changes/archive/2026-11-06-3860-core-tests-on-edge-fakes/

The JSON runner tests answer the child through process_fake. The GitHub identity tests assign no private name of core/process.py. The retry interval of a failed token lookup reads the clock seam, so a test moves it with the clock fixture.
@dan-petty dan-petty added type/test Type test: a new or changed test scope/tests The test suite, its fixtures, fakes and floor labels Nov 6, 2026
@dan-petty

Copy link
Copy Markdown
Owner Author

Test and check results:

  • Full uv run devops ci on the code before the last test edit and the rebase: 20144 passed. Two known host failures, the same as on origin/main: test_mark_only_commands_under_global_dry_run and test_the_direct_executor_refuses_a_network_profile_before_it_starts_the_tool[direct].
  • After the last two test edits and the rebase: tests/core and tests/config/test_isolation_tripwire.py pass (1544 tests). The pre-push static checks pass.
  • Review fixes: the retry test now checks that git does not look again one second before the interval ends, and that it looks again at the interval. The JSON runner test checks the exact error text.
  • Why test_subprocess_env_boundary.py keeps 11 subprocess.run patches: those tests check DefaultProcessRunner, which process_fake replaces. See design.md, decision 1.
  • The other items of test(cli): Use edge fakes and real git; drop test rebind hooks #1333 move the other core test files.

@dan-petty
dan-petty marked this pull request as ready for review November 6, 2026 23:11
@dan-petty
dan-petty merged commit a2429e3 into main Nov 6, 2026
24 checks passed
@dan-petty
dan-petty deleted the test/1333-core-tests-on-edge-fakes branch November 6, 2026 23:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

scope/tests The test suite, its fixtures, fakes and floor type/test Type test: a new or changed test

Projects

None yet

Development

Successfully merging this pull request may close these issues.

test(core): core tests run on the process and GitHub fakes

1 participant