Repository navigation
test: split three oversized test files by topic (part 2 of 2) - #20587
Conversation
Part 1 split test_prompts.py and test_runtime_reconcile.py and moved test_apps_registry_coverage.py's shared fakes and its tail run into apps_registry_coverage_helpers.py and the _install and _characterization parts. This moves the front run: the small gates and helpers the registry checks before it fetches (streamed log lines, the child environment, URL shape, sandbox mode, trusted hosts, the registry file) to _gates, the manifest cache, fetch, merge and enrichment to _manifests, and candidate resolution, the git-provenance reader, the stale-checkout sweep and the process-group kill to _provenance. test_apps_registry_coverage.py keeps the build step, TestRunAppBuild (1,562 lines). Kept in its original file it keeps its BASE layout (the file is in .github/black-baseline.txt, and black grows the class past what a new 1,600-line file can hold). Every test function and class moves with an identical AST, black- formatted in its new file. The collected (class, name, params) multiset is identical (383 tests). Glue: the remainder's module docstring names its five siblings; an own-line nosemgrep and flake-ok marker sits above each of the three pre-existing sleep sites that move. The line-cap baseline drops the file's row. Part of #20192
UX Review (Opus 5.5) — ⏭️ skippedRevision |
First Principles Review (Opus 5.5) — ⏭️ skippedRevision |
Design Review (Opus 5.5) — ✅ PASSDesign-level review of Design-Verdict: PASS Check that the autouse [DESIGN-REVIEWED] 0411f78 Description read[DESCRIPTION-READ] 380171129a304c47b4ab83071dd1f8bdb490d17e93cf77143d4c328514d0ef57 That sha256 names everything this verdict read: the PR description, plus the 1 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with |
Opus 5.5 Review — ✅ no blocking findingsReviewed Verdict parsed from the review's SHA-scoped output markers for commit False positive or not applicable? A repository writer can comment: |
GPT 6.1 Review — ✅ no blocking findingsGPT 6.1 completed its review of This comment is updated in place on each push. Review detailsNo findings. False positive or not applicable? A repository writer can comment: |
|
KiroCrewCaptain
left a comment
There was a problem hiding this comment.
Approved after a maintainer read the review lanes on this head: all clean.
Problem / Motivation
Goal: Bring
test/test_apps_registry_coverage.pyunder the 2,000-line cap by moving its front half into topic files, without changing a single test.Part 1 (#20537, merged) split
test/test_prompts.pyandtest/test_runtime_reconcile.py, and movedtest/test_apps_registry_coverage.py's shared fakes and its tail half out. The file still holds 3,597 lines, almost twice the cap.Why it matters
The maintainers' rule is that no hand-written file may exceed 2,000 lines. This file breaks it, and its topics are already separate: the registry's small gates, its manifests, where it installs from, and its build step. Splitting along those seams makes each topic findable by file name and gives each file room to grow.
Not a goal
What changed (motivation → approach → change)
The file splits along its own section banners, by the behaviour under test. The original path keeps the build step,
TestRunAppBuild. That class cannot move: the file is listed in.github/black-baseline.txt, new files must be black-clean, and black grows the class to 1,577 lines, which leaves no room for a new file's header under 1,600. Kept in place it keeps its BASE layout, and it is the original's one suffix run, so git's default diff lines it up. A recipe tool did the move from part 1's head, so it can be re-run after a rebase instead of hand-merged.test_apps_registry_coverage.py(3597 → 1562)_run_app_build's command selection and executiontest_apps_registry_coverage_gates.py(407)test_apps_registry_coverage_manifests.py(850)test_apps_registry_coverage_provenance.py(793)Part 1's
test_apps_registry_coverage_install.py,_characterization.pyandapps_registry_coverage_helpers.pyare unchanged; every new part imports the shared fakes from that helpers module.Glue, the only lines whose AST or comments change:
kirocrew.test-sleep-as-barrierfindings move into_provenance(TestCloneOriginUrl, and two inTestKillProcessGroup: hangs in fake processes that a patched timeout or the kill path cuts short). Each gets an own-line# nosemgrep: <rule> -- <reason>directly above it and an own-line# flake-ok: <reason>, code unchanged..github/file-line-cap-baseline.txtdeletes the file's row.Backwards compatibility
Compatible: test-only change. Every collected test keeps its class, name and parameters (the multiset is identical before and after). No other test module imports from this file. No production module, import path, patch target or CLI changes.
Removes nothing: every test, fixture and helper still exists, moved with an identical AST.
Tests
No test was added or rewritten. These checks show the move lost nothing:
pytest --collect-onlyover the 6test_apps_registry_coverage*.pyfiles vs the file at the series' BASE(class, name, params)multiset is identical-n 3test/test_flake_pattern_ratchet.py,test/test_wait_discipline_ratchet.py,test/test_file_line_cap.py(-n0)--baseline-commitorigin/main, over the 4 changed files--disable-nosemover the 3 new files exactly the 3 marked findings, and every file parsesisort/flake8/black --checkover the changed files;scripts/check_file_line_cap.pyMove audit
The one changed unit is the module docstring. Every test function and class moved with an identical AST, black-formatted in its new file.
Diff alignment: the original keeps one suffix run (
TestRunAppBuild) after its header, andgit diff --numstatandgit diff --minimal --numstatadd the same lines (test_apps_registry_coverage.py4/4).git diff origin/main...HEADis 183,674 bytes.Content scan:
TestEnvHelpersmovesssh -i /home/me/.ssh/id_ed25519verbatim; the same placeholder home shape (/home/u/.ssh) merged in #20166.Logger names: no new module defines a logger.
CI path references
None: no workflow filter, explicit file list,
AUTOSDE.yamlglob or sensitive-change glob names this file.Manual verification
N/A: unit coverage is sufficient. This is a test-only move; the collected-test multiset and a full run of every moved test show it.
Related Issues
Part of #20192
Follow-up: #20383 (pre-existing shapes moved verbatim; de-flake there)
Checklist
feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)