Skip to content

test(tests): run build_subprocess_env in ProcessFake (#5891) - #7187

Merged
dan-petty merged 1 commit into
mainfrom
test/5891-process-fake-env-check
Nov 25, 2026
Merged

dan-petty merged 1 commit into
mainfrom
test/5891-process-fake-env-check

Conversation

@dan-petty

Copy link
Copy Markdown
Owner

ProcessFake now runs build_subprocess_env across run, run_async, and spawn_detached so tests fail with SecurityError on prohibited environment overrides as DefaultProcessRunner does in production. ProcessFake.spawn_detached accepts optional env, ProcessFake.run_async records isolate_env and extra_allowed_env on ProcessCall, and tests/core/test_process_fake_env.py proves sync, async, detached, flag-forwarding, and allowed-override cases.

Closes #5891

Change: openspec/changes/archive/2026-11-25-5891-process-fake-env-check/

@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 25, 2026
@dan-petty

Copy link
Copy Markdown
Owner Author

Full-Suite Caller Census (#5891)

Ran the full test suite (uv run pytest -n 4 -q --tb=short) in w-5891 with ProcessFake enforcing build_subprocess_env:

  • 28,014 passed, 3 skipped, 3 failed (zero failures from ProcessFake SecurityError overrides).
  • tests/roadmap/stage/test_roadmap_stage_github_snapshot.py::test_agent_phase_offers_stock_tools_only_without_read_issue_or_find_issues: pre-existing failure on 851a87c24, resolved in origin/main by #7183 (06f35ef30).
  • tests/roadmap/steps/test_roadmap_step_fix_checks_repair.py::test_two_stops_on_a_generated_document_are_each_settled and tests/roadmap/implement/test_roadmap_implement_phases.py::test_a_generated_doc_that_main_deleted_follows_main_in_the_rebase: failed only because the outer shell sets GIT_EDITOR=false, which git_for_real (tests/support/implement_step.py:146) inherits directly; both pass under env -u GIT_EDITOR.
  • Conclusion: Zero callers across src/ or tests/ pass a refused environment override through ProcessFake.

@dan-petty
dan-petty marked this pull request as ready for review November 25, 2026 14:59
@dan-petty
dan-petty merged commit e04d9c8 into main Nov 25, 2026
25 checks passed
@dan-petty
dan-petty deleted the test/5891-process-fake-env-check branch November 25, 2026 15:00
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(tests): the process fake skips the env check of the runner

1 participant