Repository navigation
test: split four 3,500-line test files into topic parts - #21225
Conversation
UX Review (Opus 5.5) — ⏭️ skippedRevision |
First Principles Review (Opus 5.5) — ✅ PASSPremise-level review of First-Principles-Verdict: PASS Nothing to check. What this change shipsInventory (5 items) — 5 justifiedIntent: bring four test files of about 3,500 lines each under the 2,000-line cap, moving every test unchanged. This is a FIX for
[FIRST-PRINCIPLES-REVIEWED] 662bcd2 Description read[DESCRIPTION-READ] c151c86c2bb4dc81dcbba5a9a133fc6d6f093562b3c452487f545d1a0faa2f56 That sha256 names the PR description this verdict read. Recompute it with |
Design Review (Opus 5.5) — ✅ PASSDesign-level review of Design-Verdict: PASS Nothing to check. [DESIGN-REVIEWED] 662bcd2 Description read[DESCRIPTION-READ] 9ae8cbc890c15cb2be6f33db0687d2b895963398cc484a8b004f49bb8c780258 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: |
cde6a0e to
1ac51e3
Compare
1ac51e3 to
1fcc24c
Compare
|
Rebased onto main
The four remainders and every other part are unchanged. The collected tests (651) and each test's fixture list still match main's originals. CI is re-running. |
1fcc24c to
0f08581
Compare
|
Rebased onto current main. #21458 deleted line-cap baseline rows next to this PR's four deletions, and #21077 edited |
0f08581 to
026e9a4
Compare
|
Rebased onto current main. #21604, #21487 and later merges deleted line-cap baseline rows next to this PR's four deletions, and that was the only conflict: main's rows are kept and this PR's four rows stay removed. One citation changed: the moved comment above |
test_aws_control_app.py, test_webex_dispatch.py, test_agent_panel_routes.py and test_acp_deepseek_backend.py were each over 3,400 lines, past the 2,000-line cap for hand-written files. Each now keeps its first sections and moves the rest, verbatim, into sibling test_<stem>_<topic>.py files; the module-level fakes, builders and fixtures more than one file reads move to a <stem>_helpers.py module that every part imports by name. The collected tests are the same 651 (class, name, params), each test sees the same fixtures in the same order, and the four rows leave .github/file-line-cap-baseline.txt. Node ids, a spec citation and test docstrings that name a moved test follow it to its new file. Part of #20192
026e9a4 to
662bcd2
Compare
|
Rebased onto current main. #21191 ("stop resolving project-report for an unadopted crewmate") edited |
KiroCrewCaptain
left a comment
There was a problem hiding this comment.
Every review lane on the head is clean (only runner notices and PR Scope size warnings); held by the triage cron on size or path rules alone. Approved on the watch holder's request.
Problem / Motivation
Goal: Bring
test_aws_control_app.py,test_webex_dispatch.py,test_agent_panel_routes.pyandtest_acp_deepseek_backend.pyunder the 2,000-line cap by moving their tests, unchanged, into topic files.Each of these four test files was 3,486 to 3,587 lines long, well past the cap the repository now
enforces on hand-written files (
scripts/check_file_line_cap.py). All four sat in.github/file-line-cap-baseline.txt, andtest_agent_panel_routes.pyhad already grown past its row.Why it matters
A test file this long is hard to review and hard to own: one change touches a file thousands of lines
long, review lanes read huge diffs, and a new test has no obvious home. The cap only holds if the files
already over it are split, and every week they stay over, feature PRs keep adding to them.
Not a goal
src/edit is a comment that names where a moved test lives.What changed (motivation → approach → change)
Each file is over the cap, so each keeps its first sections and its other sections move, byte for byte,
into sibling
test_<stem>_<topic>.pyfiles named for what they test. The module-level fakes, buildersand fixtures that more than one file reads move to a
<stem>_helpers.pymodule, which each file importsby name. The split is a recipe that reads each file at the base commit, so it can be re-run after a
rebase rather than hand-merged.
test/test_aws_control_app.py(3,522 → 1,390)aws_control_app_helpers.py(101),test_aws_control_app_shares.py(278),test_aws_control_app_hardening.py(1,137),test_aws_control_app_profiles.py(698)test/test_webex_dispatch.py(3,521 → 1,459)webex_dispatch_helpers.py(398),test_webex_dispatch_commands.py(614),test_webex_dispatch_cards.py(451),test_webex_dispatch_spaces.py(291),test_webex_dispatch_queue.py(450)test/test_agent_panel_routes.py(3,587 → 774)agent_panel_routes_helpers.py(281),test_agent_panel_routes_allocation.py(881),test_agent_panel_routes_publish_order.py(310),test_agent_panel_routes_dashboard.py(973),test_agent_panel_routes_page.py(508)test/test_acp_deepseek_backend.py(3,486 → 1,149)acp_deepseek_backend_helpers.py(171),test_acp_deepseek_backend_enforcement.py(680),test_acp_deepseek_backend_session.py(299),test_acp_deepseek_backend_effort.py(505),test_acp_deepseek_backend_vault.py(793)aws_control_app_helpers.pyis under 150 lines because it is only the shared request builders, theguarded-surface patches and the autouse snapshot reset that four files import. The four rows leave the
line-cap baseline, and the node ids, spec citations and comments that name a moved test follow it.
Backwards compatibility
Compatible: only test files move, and no other test imports any of the four.
Removes nothing: every test, fixture and helper still exists and runs; node-id lists and citations that
named a moved test now name its new file.
Tests
No test is added or changed; the proof is that the same tests run with the same fixtures.
pytest --co -qqover the 4 originals at the base and the 19 files at the head: 651and 651; the multiset of (class, test name, params) is identical.
pytest --fixtures-per-test: for all 651 tests the ordered fixture list is identical at the base andat the head (autouse fixtures included).
-n 3). The related set plus every test that scans the test tree or readssource_corpus(126 files): 12,787 passed, 24 skipped, 0 failed.test_flake_pattern_ratchet.py(
-n0): 58 passed.scripts/local-gate.py --base <base> --dry-run: backend related 41 files (run, all green); frontendrelated 367 files (cross-surface set only: this diff changes no
website/file).flake8,isort --check,black --checkon every changed file;mypy src/kiro_crew; thecomment-history, brand, harness-parity, line-cap, black, subprocess-encoding, feature-map, testpaths
and docs-lint gates; semgrep (
p/python,p/typescript,p/security-audit,p/secrets,p/owasp-top-ten,semgrep/,--baseline-commit <base>): all clean.Move audit
vetted: the fixture is re-declared@pytest.fixture(name="vetted") def vetted_fixture(...)inagent_panel_routes_helpers.py(thetest/meetings_helpers.pyconvention), so the test parametervetteddoes not shadow an import. The body is unchanged._Sessions: one docstring sentence said "the real allocation tests below"; in the helpers moduleit names
test_agent_panel_routes_allocation.py, where those tests now are.Expr:test_acp_deepseek_backend.py's module docstring gains one sentence naming where the movedpins live.
Every other unit is AST-identical. Comment lines added inside moved units:
# nosemgrep: kirocrew.test-autouse-shared-monkeypatchmarkers on the moved autousefixtures (
TestShares._isolated_store,_crew_log_on,_pinned_kiro_cli_version); no test thatsees them calls
monkeypatch.undo();# flake-ok:markers on the timing shapes that moved:_spin's bounded poll (2), theeight
assert (await task)[0]awaits inTestApprovalCardPressandTestGroupSpaceRouting, andTestRound36Hardening's UTC wall-clock read.Diff alignment
For every changed file,
git diffandgit diff --minimaladd the same lines (blank lines counted):test_aws_control_app.py8/8,test_webex_dispatch.py14/14,test_agent_panel_routes.py11/11,test_acp_deepseek_backend.py7/7, and equal for every other file.git diff <base>...HEADis about 871 KB (under the 900 KB cap).Path references
.github/file-line-cap-baseline.txt: the four targets' rows are deleted.test/requires-real-symlinks.txt: the twoTestRound17Hardening/TestRound18Hardeningnode idsnow name
test/test_aws_control_app_hardening.py.docs/system-specs/modules/aws-control.md:TestProfileUnregisterandTestBootstrapReauthorizescite
test_aws_control_app_profiles.py;TestRound17Hardeningcitestest_aws_control_app_hardening.py.test/test_aws_control_backup.py(module docstring),test/test_aws_control_routes.py(module docstring and a section comment),test/test_member_dashboard_routes.py(twodocstrings),
src/kiro_crew/dashboard/server_runtime/mcp_routes.py(one comment).test/test_acp_deepseek_backend_effort.py:260(a moved comment):agent_sdk/backends.py->agent_sdk/backends_models.py, where refactor: split agent_sdk/backends.py into vocabulary owner modules #21616 moved the effort-level table it names.CI path references
None: no workflow path filter or explicit file list names any of the four files.
Manual verification
N/A — test-only move; the collected-test and fixture comparisons above are the verification.
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: ...)