Skip to content

test(cli): tests find the repository root and fixtures from any depth, import no other test module and build test data with shared builders, and devops test maps a change to its mirror directory #1312

Closed

Description

@dan-petty

Problem

The move (#1313) is decided as a pure git mv of whole files into mirror directories, with no content edits. Today's tests break at any other depth, and the package items that follow it have no shared test data or snapshot library to adopt:

Acceptance criteria

Paths and imports

  • tests/support/ is a package that the root conftest registers once, so fixtures added there later are available everywhere. It provides the repository root, tests/fixtures and tests/golden as paths anchored at its own location.
  • The 48 modules, the root conftest and the 7 fixture readers use those paths. No test module resolves a path from its own __file__.
  • Nothing imports tests.conftest or another tests.test_* module.
    • PINNED_GITHUB_TOKEN, fail_the_github_lookup, the tripwire helpers and the four board-reply helpers move to tests/support/.
    • CONST_FORBIDDEN_PROJECT_TEST_PATHS moves with the tripwire and leaves src.
  • An invariant test fails, naming path:line, in two cases: a test module outside tests/support/ that builds a path from its own __file__, and an import statement of tests.conftest or of another test module. It joins the source-tree invariants: tests/invariants/test_source_tree.py if test(cli): ratchets hold internal patches, private imports and test accommodations in src at today's counts and name each site that would raise one #1309 has created it, otherwise tests/test_architectural_invariants.py.

Builders and snapshots

  • tests/support/builders.py holds the builders the package items use (Q20): one plain function per CONTEXT.md term, named after it, that builds a valid object from defaults through the type's public constructor or parser, so whatever validation the type has runs, and takes keyword overrides:
    • make_finding: a review Finding [code: ai/review_schema.py:673];
    • make_verdict: a Verdict [code: ai/review/adjudication.py:94];
    • make_item, make_release and make_candidate: the roadmap's Item, Release and Candidate [code: roadmap/store.py:238, :206, :226];
    • make_changelog_fragment: a ChangelogFragment [code: release/changelog_fragments.py:50] whose text goes through parse_changelog_categories [code: release/changelog_fragments.py:99], so a fragment that changelog.d/ would refuse is refused here too.
  • A test per builder shows that its defaults build a valid object and that an override reaches the object; for the pydantic types, an override the type rejects raises the type's own ValidationError. The local _finding(...) helpers are not converted here; each package item adopts the builders in its own files.
  • release_notes_examples.py and markdown_examples.py move into tests/support/ beside builders.py, and their three importers import them from there.
  • syrupy joins the dev dependency group, pinned as syrupy==6.1.1, with its uv.lock entry. uv run pytest --help lists --snapshot-file-lock, the flag Q18 prescribes for snapshot updates. No test uses syrupy yet.

devops test

  • devops test finds test modules at any depth under tests/. A changed src/devops_cli/<path>/<module>.py selects every test module directly in tests/<path>/ when that directory exists, plus today's name candidates found at any depth.
  • Tests over a temporary git repository show three cases: a changed nested test module is selected; a changed source module selects its mirror directory; a flat tree maps as it does today.

Proof and housekeeping

Key questions

Strategic alignment

Activity

  1. added
    type/test
    scope/cli
    priority/p2-medium
    scope/ci
    on Oct 7, 2026
  2. 7 remaining items

  3. added
    status/in-progress
    on Oct 19, 2026
  4. dan-petty commented on Oct 19, 2026

    @dan-petty
    OwnerAuthor

    Decision (owner, 2026-10-19): where PR 5's ban runs

    The ban (test_no_test_module_finds_a_path_from_its_own_file_or_imports_a_test_module) runs only in the full gate: uv run devops ci and the pre-push hook. It never runs in a commit's narrowed devops ci test selection. It parses every test file, which takes about 1 s idle and 4.3 s at load 31, and CI gate speed is P0.

    PR 5 picks the mechanism the selector already supports, and adds a test showing that a narrowed selection over any staged source never includes the ban, while the full run always does. The plan's Decisions section carries this line.

  5. dan-petty commented on Oct 19, 2026

    @dan-petty
    OwnerAuthor

    Amendment (2026-10-19): decide a tests/support/ change precisely before PR 4

    PR 2 sends every change under tests/support/ to the whole suite, as this item's plan decided. A replay of the last 40 commits (scratch measurement on PR 2) showed what that costs:

    • tests/support/paths.py is imported by 66 test files (2,521 test IDs, 55-78 s at -n 0).
    • The whole suite is 480 files and 10,764 IDs. In the gate cache it took 154-187 s on a quiet machine and 538-905 s under load, past the 5-minute budget.
    • At PR 2 no support module defines a fixture, and no conftest imports tests.support.

    Selecting only the modules that import a support file is not sound on its own:

    • once PR 3 registers support modules as plugins, their fixtures reach tests by name, with no import;
    • the current importer search is a regex over direct imports, so it misses support modules that import each other.

    Proposed for PR 3 or PR 4, before PR 4 adds fakes and builders: classify the changed support module with ast.

    • Whole suite when it is named in a conftest's pytest_plugins or by -p, defines a pytest.fixture or a pytest_* hook, or is imported, directly or transitively, by such a module or by any conftest.
    • Otherwise select the test modules that import it transitively, using an AST import graph over tests/.

    That stays sound and keeps a paths, fake or builder edit from paying for a full run on every commit.

  6. dan-petty commented on Oct 20, 2026

    @dan-petty
    OwnerAuthor

    What changed

    #1711, merged into release/v0.2.37 as 0d27928.

    The last of #1312's five pull requests. No test module reads a path from its own file or imports another test module, and a ban that runs in the full gate keeps it that way. This closes #1312.

    The last sites.

    • The final eight Path(__file__) lines, in six test modules, read tests.support.paths.
    • No module keeps a root constant or an alias of one. tests/test_github_session.py uses REPO_ROOT. tests/test_roadmap_github_store.py imports FIXTURES and names its own directory ROADMAP_FIXTURES.

    The ban: tests/test_test_module_independence.py.

    • What it reads: it parses every Python file under tests/ once, except tests/fixtures/, conftests and helper modules included.
    • What it reports, as path:line:
      • each bare __file__ outside tests/support/;
      • each import of a test module or a conftest, through absolute or relative imports, import, from X import n and as aliases;
      • each relative import past the top-level package.
    • How it decides: pytest's own python_files patterns say what a test module is. A relative import resolves against the importing module's package. from X import n counts as X.n only when X is a package or X/n.py exists.
    • What passes: a module's __file__ attribute, devops-cli modules named test_*, and functions imported from a plain support module.
    • The seeded tree: a tree under tmp_path pins each reported and each allowed form, including plants in a conftest and a helper. The banned form…

    11 file(s) changed.

    How it was verified

    Check runs at 84302ca:

    • Audit Defect PR Hardening: skipping
    • Prune PR DevContainer Images: pass
    • devops-cli: pass
    • zizmor: pass
    • bandit: pass
    • CodeQL: pass
    • Analyze (python): pass
    • Rule Pack Tests: pass
    • Changed-Test Independence: pass
    • Fail-to-Pass Self-Check: pass
    • Tests & Coverage: pass
    • Fail-to-Pass Check: pass
    • Analyze (actions): pass
    • Static Analysis: pass
    • DevContainer Image: skipping
    • Service Image: skipping
    • Dependency Freshness: skipping

    Acceptance Criteria of docs/agent/tasks/task-1312-tests-find-paths-from-any-depth.md:

    • The shared paths are the repository root and its test data directories: tests/test_architectural_invariants.py::test_the_support_paths_are_the_repository_root_and_its_test_data_directories (REPO_ROOT / "pyproject.toml" names project devops-cli, TESTS_ROOT == REPO_ROOT / "tests", and FIXTURES and GOLDEN are directories).
    • (Historical, PR 1 to PR 4.) Outside tests/support/, rg -n 'Path\(__file__\)' tests printed only the 8 lines in 6 files left for PR 5: tests/test_github_session.py:54, tests/test_k8s_agents_manifests.py:13, tests/test_k8s_argocd_apps.py:16, tests/test_k8s_devops_stack.py:69, :100 and :123, tests/test_roadmap_config.py:125 and tests/test_roadmap_github_store.py:90 (:91 at PR 5's base). PR 3 removed the root conftest's 3 sites, and feat(agent): read-only agent identity under GitOps (Closes #1154) #1684 added tests/test_k8s_agents_manifests.py:13 after PR 1. PR 5 converted the 8, and the check now prints nothing (the PR 5 criterion below).
    • The ratchet runs as a module: uv run python -m tests.test_swallowed_failures_ratchet prints Usage: uv run python -m tests.test_swallowed_failures_ratchet --lower, exits 1 and writes nothing, and test_ratchet_fails_when_file_under_ceiling_and_prints_lower_command checks that the under-ceiling message holds that command. Run as a script, uv run python tests/test_swallowed_failures_ratchet.py --lower prints the same usage line and exits 1, with no traceback (test_run_as_a_script_it_names_the_module_command_and_exits_1).
    • No test outcome changes. At a153042, uv run pytest --collect-only -q collects 10703 tests; with PR 1 it collects 10704, the same IDs plus the new paths test. The full run under -n 8 at a153042 gave 10692 passed, 2 failed, 1 skipped and 8 xfailed; the two failures, tests/test_cli_startup_imports.py::test_cli_startup_import_budget_command_help[argv1] and [argv2], are refactor(ai): startup import budget invariants and dry-run isolation tests (#1002) #1680's 1.0 s wall-clock import budget exceeded at load average 13 and passed on a rerun at load average 3. With PR 1, under the same options: 10695 passed, 1 skipped and 8 xfailed, nothing failed, the base's outcomes plus the new test.
    • devops test run --changed maps changes as decided, in real repositories under tmp_path read through --dry-run's JSON (tests/test_test_runner.py): a nested test module selects itself; src/devops_cli/ai/review/pipeline.py selects tests/ai/review/test_pipeline.py, named for it, and not test_a.py and test_b.py beside it; a source module in the flat tree selects the test module named for it and one that imports it; a conftest of fixtures selects its directory and one with a hook selects tests; a support module selects tests (since PR 3, one that defines a fixture, is deleted or is renamed, whose old path is listed as deleted; one that registers nothing selects the test modules importing it, and a support subpackage's __init__.py the test modules importing its modules, not its directory); a staged git mv selects by the new path and, since PR 3, the old one; a deleted test module is not passed to pytest; an unmapped source is named while the mapped tests run; an untracked test package's module runs and its __init__.py selects its directory, neither named as unmapped; and no change runs tests.
    • A module, a package's __init__.py too, selects no test module only for sitting in the directory that mirrors its package, and a nested conftest selects tests when it binds a hook, defined, imported or star-imported, or cannot be read, and its own directory when it holds fixtures only (tests/test_test_selection.py: test_a_module_selects_no_test_module_only_for_sitting_in_its_package_directory, test_a_nested_conftest_selects_the_whole_suite_when_it_binds_a_hook).
    • A change that forces a full run by its name selects tests with no test module listed or read, for tests/conftest.py, conftest.py, pyproject.toml, uv.lock and .python-version beside a changed source (test_a_change_that_forces_a_full_run_selects_the_suite_without_reading_the_tests); PR 3 took tests/support/paths.py out of that list, since a support module is now classified by what it defines and who imports it.
    • With no index, every name in CONST_FULL_RUN_TRIGGER_NAMES, as given or after ./, exits 1 under --no-fallback and runs the full suite under --fallback (test_cli_test_every_trigger_name_forces_a_full_run_as_given_or_after_a_dot_slash), and a path loses only a leading ./ (test_a_relative_path_loses_only_a_leading_dot_slash).
    • devops ci treats a support module that defines a fixture like a conftest: test_cli_test_a_support_module_that_registers_a_fixture_forces_full_run (full suite with and without an index, exit 1 naming the file under --no-fallback) and test_a_support_module_that_defines_a_fixture_forces_a_full_run (tests/test_coverage_index.py), as PR 3 renamed them; until PR 3 every support module did.
    • A trigger that changed since the coverage index was built leaves the index stale: an unrelated source is selected by name and import, even under --no-fallback, and the warning names the file (test_cli_test_a_trigger_changed_since_the_index_was_built_selects_by_text, for a support module that defines a fixture, since PR 3, and pyproject.toml).
    • Ceilings only go down: the two # noqa: C901 markers in src/devops_cli/commands/test_cmd.py are gone and DEFAULT_C901_SUPPRESSION_CEILING is 47.
    • The registration works and keeps HOME isolated (PR 3, tests/test_isolation_tripwire.py, first): test_support_fixtures_reach_a_nested_test_and_load_after_home_is_isolated runs one pytester subprocess over a project whose conftest holds only pytest_plugins = ("tests.support.bootstrap",), where a/b/test_x.py gets no_github_identity and devops-cli's CONST_CONFIG_DIR lies under the isolated HOME; loading tests.support.github_identity first, through pytest_plugins or -p, fails the second test, because CONST_CONFIG_DIR then lies under the HOME pytester sets, its project directory, and not under the HOME bootstrap isolates. test_devops_cli_binds_its_config_directory_under_the_home_bootstrap_isolated checks the same in this suite's own run, under the real root conftest, and fails when that conftest's pytest_plugins names tests.support.github_identity before tests.support.bootstrap. test_a_support_package_that_fails_to_import_fails_the_registration_naming_it registers, with a real pytest.PytestPluginManager(), a package under tmp_path whose subpackage imports but whose broken/inner.py raises ImportError, and the error names broken.inner, which only a walk into subpackages reaches (with pkgutil.iter_modules in place of walk_packages it fails). test_registration_fails_naming_a_fixture_the_test_selector_cannot_see fails the registration with pytest.UsageError naming the module and the attribute, for a fixture made by a decorator factory, one made through getattr(pytest, "fixture"), one re-exported under a new name and one handed out by a module-level __getattr__ and __dir__, and passes none when the check is removed; the last also passed while the check read vars(module). test_a_test_module_or_conftest_under_the_support_package_fails_the_registration fails it naming inner.test_hidden or inner.conftest, and failed before the registration refused them. test_a_support_module_that_defines_its_fixture_with_the_decorator_registers registers one defined with pytest.fixture. test_session_hooks_lifecycle checks that the tripwire snapshots rootpath, and fails when it snapshots the checkout. The other tripwire tests pass with their imports and call-site names changed.
    • The root conftest has one pytest_plugins entry, naming tests.support.bootstrap, and no pytest_configure, pytest_sessionstart, pytest_sessionfinish or pytest_terminal_summary; pyproject.toml has the one error::pytest.PytestAssertRewriteWarning filter; rg -n 'CONST_ISOLATED_TEST_ENV_KEYS|verify_test_paths_isolated|_check_test_paths_isolated' src tests prints nothing; rg -l CONST_FORBIDDEN_PROJECT_TEST_PATHS src tests prints src/devops_cli/config/constants.py and tests/support/workspace_tripwire.py.
    • A support module is classified with ast (PR 3, test_a_support_module_reaches_every_test_by_what_it_registers_who_imports_it_or_when_unread in tests/test_test_selection.py): a plain helper, whose docstring names a fixture, selects the test module importing it; one that defines a fixture with pytest.fixture or with fixture imported from pytest, one that defines a hook, one a fixture module imports, one a fixture module imports through another helper, one a nested conftest imports at its top and one it imports inside a fixture select tests; a test module importing it through another support module is selected, and two helpers that import each other end the walk; a deleted one selects tests. Each case fails when the classifier's clause for it is removed: the fixture clause, the from pytest import fixture clause, the hook clause, the closure from the roots (cut to one hop), the conftest as a root, imports inside functions, an unreadable module, and the transitive walk; without the walk's guard against modules already reached, the import cycle never ends (still running after 60 s). test_a_package_init_selects_the_test_modules_importing_its_modules_not_its_empty_directory and test_the_tests_package_init_reaches_every_test_through_the_conftest fail without the package edges, and the former when a package directory with no test module is handed to pytest. devops test run --changed selects the importers of a changed plain support module, those of a support subpackage's modules for its __init__.py, and tests for one that defines a fixture, is deleted beside a mapped change, or is renamed, staged or committed (tests/test_test_runner.py; the rename cases also check that _changed_paths lists both the old and the new path and no old -> new line, and each fails when its --no-renames is removed); uv run devops ci test tests/support/paths.py --no-fallback exits 0 running the test modules that import it (test_cli_test_a_plain_support_module_runs_the_test_modules_importing_it), where the plan, written before the amendment, had it exit 1, and a helper deleted since the coverage index was built forces the full suite, or exits 1 naming it under --no-fallback, with its own warning (MESSAGES.ci.coverage_index_helper_removed) in place of the stale index's "selected by name and import" (test_cli_test_a_helper_deleted_since_the_index_was_built_forces_a_full_run).
    • The rule's premises hold over the real tree (PR 3, tests/test_architectural_invariants.py): test_no_helper_module_under_tests_acts_on_import failed at first on tests/cluster_secret_fakes.py:31 and tests/roadmap_faults.py:35, and passes now; test_only_bootstrap_imports_the_support_package_itself fails when bootstrap is not exempt. Their seeded-tree tests report each refused form as path:line and none of the allowed ones: the side-effect test's three class-body forms (an attribute assignment, an import, and a call in a nested class) went unreported before the check read class bodies, and a class-body assignment added to tests/support/paths.py fails the real-tree test; the package test's alias, dotted-attribute, subpackage, relative subpackage and dynamic-import forms went unreported before the check covered them.
    • No test outcome changes (PR 3). At its base, 7473b60, the full run under the scratch -p guard against gh children, uv run pytest -n logical -p no_gh_child -q, gave 10898 passed, 1 skipped and 8 xfailed, of 10907 collected; with PR 3, 10930 passed, 1 skipped and 8 xfailed, of 10939. Two tests of tests/test_server_service.py, which PR 3 does not touch, each timed out once on a queue in a run under load, one at 3b70671 at a load average of 48 and one in the commit hook at 24, and each passed in three runs of its own. Of the base IDs, test_check_test_paths_isolated_rejects_project_dir is deleted; test_a_change_that_forces_a_full_run_selects_the_suite_without_reading_the_tests[tests/support/paths.py] is dropped; test_cli_test_support_module_forces_full_run, test_a_changed_support_module_selects_the_whole_suite and test_a_support_module_change_forces_a_full_run are renamed for a support module that defines a fixture; test_cli_test_a_trigger_changed_since_the_index_was_built_selects_by_text[tests/support/paths.py] is now [tests/support/identity.py]; and test_a_renamed_source_module_selects_by_its_new_path is now test_a_renamed_source_module_selects_by_its_new_path_and_its_old_one, which also expects the test modules named for or importing the old module. The 39 added IDs are those 5 renamed or re-parametrized tests, the 10 registration and HOME tests, the 4 invariant tests, the 11 classification cases, the 2 package __init__.py tests, the 5 runner tests for a plain, subpackage, renamed (staged and committed) and deleted support module, and the 2 CLI tests for a plain support module and a helper deleted since the index was built.
    • The builders behave: uv run pytest -n 0 -q tests/test_support_builders.py tests/test_release_changelog_fragments.py passes. Each builder's defaults build a valid object of exactly its type, a finding one its own is_empty keeps, and an override reaches the built object, an Item's and a candidate's URL following the number (test_each_builder_builds_a_valid_object_from_its_defaults, test_an_override_reaches_the_built_object, over the six builders and make_finding(saved=True)). A key that is no field of the model, file= among them, raises TypeError naming it (test_an_override_the_model_has_no_field_for_raises_a_type_error_naming_it). A value the model refuses raises pydantic's ValidationError for Finding, SavedFinding, Item, Release and Candidate (test_an_override_the_model_rejects_raises_its_validation_error). Text outside a category and a heading with no entry raise the reader's ValidationError for each, changelog.d/7.md:1 is outside a category and changelog.d/7.md holds no changelog entry (test_a_fragment_the_reader_refuses_is_refused_by_the_builder_naming_its_file). parse_changelog_fragment refuses changelog.d/notes.md by name, and the reader refuses a misnamed file holding bytes that are no UTF-8 by name, not with UnicodeDecodeError; the reader's other tests pass unchanged.
    • The example modules and the borrowed code live under tests/support/: ls tests/release_notes_examples.py tests/markdown_examples.py fails, and rg -n '^\s*from tests\.test_\w+ import' tests prints nothing (3 lines at 8ff09c5).
    • syrupy is pinned and unused: rg -n '"syrupy==6.1.1"' pyproject.toml prints one line inside the dev group, uv.lock pins syrupy 6.1.1, uv run pytest --help | rg -- '--snapshot-file-lock' prints the option, and find tests -name __snapshots__ prints nothing.
    • PR 4 changes no test outcome. At its base, 8ff09c5, uv run pytest --collect-only -q collects 10954 tests; with PR 4 it collects 10983, the same IDs plus the 27 in tests/test_support_builders.py and the two new reader tests in tests/test_release_changelog_fragments.py. The full run under the scratch -p guard against gh children gave 10945 passed, 1 skipped and 8 xfailed at 8ff09c5, and 10974 passed, 1 skipped and 8 xfailed with PR 4.
    • PR 2 changes no test outcome, measured at PR 5 against PR 2's squash commit, 83939e6, and its parent, a9b25c9, so that no other merge counts. uv run pytest --collect-only -q -p no_gh_child collects 10815 tests at a9b25c9 and 10852 at 83939e6. PR 2 deletes 3 IDs: tests/test_test_runner.py::test_find_changed_test_files and ::test_test_run_changed_flag, which the eleven runner tests replace, and tests/test_test_selection.py::test_cli_test_trigger_file_modified_since_build_forces_full_run, which test_cli_test_a_trigger_changed_since_the_index_was_built_selects_by_text (2 IDs) replaces. It adds 40: the 11 runner tests in tests/test_test_runner.py; in tests/test_test_selection.py, that replacement, test_a_change_that_forces_a_full_run_selects_the_suite_without_reading_the_tests (6), test_a_module_selects_no_test_module_only_for_sitting_in_its_package_directory (1), test_a_nested_conftest_selects_the_whole_suite_when_it_binds_a_hook (6), test_a_relative_path_loses_only_a_leading_dot_slash (3), test_cli_test_every_trigger_name_forces_a_full_run_as_given_or_after_a_dot_slash (8) and test_cli_test_support_module_forces_full_run (1); tests/test_coverage_index.py::test_a_support_module_change_forces_a_full_run; and tests/test_swallowed_failures_ratchet.py::test_run_as_a_script_it_names_the_module_command_and_exits_1. The full run under the scratch -p guard against gh children gives 10805 passed, 1 failed, 1 skipped and 8 xfailed at a9b25c9, and 10842 passed, the same 1 failed, 1 skipped and 8 xfailed at 83939e6, 37 more passed for 40 added and 3 deleted. The failure at both is tests/test_ci_maintain.py::test_ci_maintain_live, whose live uv audit now finds three advisories against aiohttp 3.14.3; fix(deps): aiohttp 3.14.5 clears three advisories that failed every devops ci audit, and the maintain test runs no real uv audit #1698 later bumped aiohttp and took that test offline.
    • devops test run --changed listing against the branch's own base, a --base option, instead of main: perf(ci): the structural-invariants hook runs the stdlib metric once per commit, with no uv sync #1667.
    • The ban holds and names its findings (PR 5): uv run pytest -n 0 -q tests/test_test_module_independence.py -k own_file passes both ban tests, the plan's command run on the module the owner's decision gave them in place of tests/test_architectural_invariants.py, and the seeded-tree test reports each planted form as path:line and none of the allowed ones. The real-tree test parses each of the 526 Python files under tests/ once.
    • The ban runs in the full gate and in no narrowed selection (PR 5): test_no_narrowed_selection_over_a_changed_source_or_helper_runs_the_test_module_ban and test_the_full_gate_collects_the_test_module_ban pass, and uv run devops ci test <path> --no-fallback --dry-run lists the ban's module for that module itself and not for src/devops_cli/__init__.py, src/devops_cli/commands/test_cmd.py, src/devops_cli/core/test_selection.py or tests/support/paths.py, for which its pytest line names 73 test modules, the 73 whose import statements name tests.support.paths (a text search finds one more, tests/test_test_runner.py, whose match is a seeded string).
    • No test finds a path from its own file: rg -n 'Path\(__file__\)' tests -g '!tests/support/**' prints nothing (100 lines at a17b56b, 8 at PR 5's base).
    • No test imports the conftest or another test module: the ban finds no such import in the real tree, and rg -n '^\s*from tests\.test_\w+ import' tests prints nothing (3 lines at a17b56b). rg -n 'tests\.conftest' tests (6 lines at a17b56b) prints one, tests/test_openblas_worker_threads.py:18, a string holding the source a child process runs to import the root conftest (Description, PR 5), not an import in a module under tests/.
    • tests/support/ is complete: ls tests/support tests/support/fakes lists the twelve files the plan names, beside waits.py (test(cli): tests wait for a background thread with one generous bound, not a 1-second deadline, so they pass under load #1664) and fakes/model.py (refactor(ai): one model seam: llmclient over three wire adapters behind one factory, no second provider stack #1001), and ls tests/release_notes_examples.py tests/markdown_examples.py fails.
    • PR 3's and PR 4's checks hold at PR 5's tip: uv run pytest -n 0 -q tests/test_isolation_tripwire.py passes; rg -n '^pytest_plugins' tests/conftest.py prints the one entry, naming tests.support.bootstrap; rg -n 'def pytest_(configure|sessionstart|sessionfinish|terminal_summary)' tests/conftest.py prints nothing; rg -n 'error::pytest.PytestAssertRewriteWarning' pyproject.toml prints one line; rg -n 'CONST_ISOLATED_TEST_ENV_KEYS|verify_test_paths_isolated|_check_test_paths_isolated' src tests prints nothing; rg -l CONST_FORBIDDEN_PROJECT_TEST_PATHS src tests prints src/devops_cli/config/constants.py and tests/support/workspace_tripwire.py; uv run pytest -n 0 -q tests/test_support_builders.py tests/test_release_changelog_fragments.py passes; rg -n '"syrupy==6.1.1"' pyproject.toml prints the one line in the dev group, uv.lock pins syrupy 6.1.1, uv run pytest --help lists --snapshot-file-lock and find tests -name __snapshots__ prints nothing.
    • devops test run --changed maps changes as decided: uv run pytest -n 0 -q tests/test_test_runner.py tests/test_test_selection.py tests/test_coverage_index.py passes at PR 5's tip.
    • The plan's criterion that uv run devops ci test tests/support/paths.py --no-fallback exits 1 and names the file is superseded by PR 3, under the issue's amendment of 2026-10-19: a support module that defines no fixture or hook, and that no conftest or such module imports, reaches only the test modules importing it, so the command exits 0 and runs them (test_cli_test_a_plain_support_module_runs_the_test_modules_importing_it), where sending every tests/support/ change to the whole suite ran all 483 test modules for a paths.py change against 67 at PR 3. A support module that defines a fixture still forces the full run, and --no-fallback refuses it by name (test_cli_test_a_support_module_that_registers_a_fixture_forces_full_run).
    • The ratchet runs as a module: at PR 5's tip, uv run python -m tests.test_swallowed_failures_ratchet prints Usage: uv run python -m tests.test_swallowed_failures_ratchet --lower, exits 1 and writes nothing.
    • Ceilings only go down: DEFAULT_C901_SUPPRESSION_CEILING is 47, 2 below its value before PR 2, which removed the two markers, and no PR of the item raises a suppression ceiling.
    • PR 5 changes no test outcome. At its base, 16b1314, uv run pytest --collect-only -q -p no_gh_child collects 10991 tests and the full run under the guard gives 10982 passed, 1 skipped and 8 xfailed; with PR 5 it collects 10995, the same IDs plus the two ban tests and the two selection tests, and gives 10986 passed, 1 skipped and 8 xfailed. Both runs report the same 30 warnings, from third-party packages and devops-cli's Logfire bridge.
    • The move proof passes with no other edit, and its commands and results are recorded under Description, PR 5.
    • Docs stay in step: this file has no **Status** line and uv run pytest -n 0 -q tests/test_agent_task_files.py passes; docs/TESTING.md marks none of tests/support/, the shared paths, the registration, the builders, syrupy or the ban as (target); each PR updated the task files that named what it moved, as its section says, and docs/agent/tasks/task-1308-test-conventions.md records which marks docs(cli): docs/TESTING.md holds the test conventions, ADR 0005 records that tests double only process edges, and AGENTS.md and the contributor docs point to them #1308 left for this item.
    • Only PR 5 adds changelog.d/1312.md, and no PR of the item edits CHANGELOG.md or docs/ROADMAP.md: git show --stat 0ae4ea4 83939e6 9d290cc 16b1314 -- CHANGELOG.md docs/ROADMAP.md changelog.d/ names no file.
    • CI passes offline: each PR's push runs uv run devops ci through the pre-push hook, and on PR 5's tree it passes with every check green, in 4 min 45 s. No test PR 5 adds opens a socket or starts a process: the ban reads the files under tests/, and the selection tests copy files under tmp_path, link src/ there, read the gate's command and pytest's configuration, and parse the conftests and support modules. Run alone at a load average of 4 to 10, each runs in under 1 s but the real-tree ban: the narrowed-selection test in 0.4 to 0.7 s, though 1.2 s inside the full run at a load average of 11 to 21, the full-gate test in 0.02 s and the seeded-tree test in 0.01 s. The real-tree ban takes 2.0 to 2.4 s alone and 5.6 s inside the full run, and parses each file once.
  7. added a commit that references this issue on Oct 20, 2026
  8. removed
    status/in-progress
    on Oct 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    priority/p0-criticalscope/ciscope/clitype/test

    Type

    No type

    Projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions