Skip to content

test(ci): ci and test selection tests patch no names - #4103

Merged
dan-petty merged 2 commits into
mainfrom
test/3769-ci-and-test-selection-command-tests-on-edge-fakes
Nov 8, 2026
Merged

dan-petty merged 2 commits into
mainfrom
test/3769-ci-and-test-selection-command-tests-on-edge-fakes

Conversation

@dan-petty

Copy link
Copy Markdown
Owner

The tests of devops ci and of test selection now patch no devops_cli name. They run the gate in a root of their own (ci_root), and the process, git and clock fakes answer the edges.

This removes the test accommodations from src: the two reads of PYTEST_CURRENT_TEST, _current_run_subprocess, _ORIG_RUN_SUBPROCESS and the force argument of _clean_coverage_artifacts. shard_test_files and directory_modules move to core/test_selection.py, and gate_root_warnings goes to ci/diagnostics.py. An invariant bans every read of PYTEST_CURRENT_TEST in src. The stale plan 1325-ci-commands-edge-fakes is removed.

Why: #1336 turns the patch ratchets into bans, and it fails on these patches.

Closes #4087

Change: openspec/changes/archive/2026-11-08-4087-ci-and-test-selection-command-tests-on-edge-fakes/

@dan-petty dan-petty added type/test Type test: a new or changed test scope/ci GitHub Actions workflows, pre-commit hooks, CI gates, and runners labels Nov 8, 2026
@dan-petty

Copy link
Copy Markdown
Owner Author

Test results (local, before the rebase onto 120598e and the push):

  • Full uv run devops ci passed all 25 checks on the final code. The test row took 12m 41s, over the 5-minute budget, on a loaded host. Slowest tests are from other groups (test_k8s_monitoring_alerting, test_ai_local_dry_run).
  • After the rebase: tests/commands/test_ci.py, test_ci_shard.py and tests/invariants pass (763 tests).
  • Group result: 134 patches of a devops_cli name in the group go to 0.

Known leftovers (the only private uses in the group):

  • ci_module._session_returncode and ci_module._cancelled_by_stop_signals are used by two tests in tests/commands/test_ci.py. The stop-signal code has not moved to core/process.py. A later item moves it behind a public function.
  • The ci and test_selection direct tests of shard_test_files, directory_modules and gate_root_warnings sit in tests/commands/. Moving them to tests/core/ and tests/ci/ is a possible follow-up.
  • No command-level test shows both gate-root warnings (stale worktree and slow mount) together. A public seam for /proc/mounts text is needed first.

Left for later parts of #3769: the PYTEST_CURRENT_TEST reads of other commands.

@dan-petty
dan-petty marked this pull request as ready for review November 8, 2026 01:19
@dan-petty
dan-petty merged commit 4b8bd5f into main Nov 8, 2026
25 checks passed
@dan-petty
dan-petty deleted the test/3769-ci-and-test-selection-command-tests-on-edge-fakes branch November 8, 2026 01:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

scope/ci GitHub Actions workflows, pre-commit hooks, CI gates, and runners type/test Type test: a new or changed test

Projects

None yet

Development

Successfully merging this pull request may close these issues.

test(ci): ci and test selection command tests patch no names

1 participant