Repository navigation
test: split test_dashboard_chat.py, part 6 of 6 - #21036
Conversation
Move the last region of test/test_dashboard_chat.py, BASE lines 24195-26845, into topic siblings: model pick (restore probe, bulk switch, canonical-key guard), model live switch and tail fork; the GitLab allowlist and source-link tests join test_dashboard_chat_slot.py, reload and close broadcasts join test_dashboard_chat_session_authority.py, the unflushed-tail ordering tests join test_dashboard_chat_unflushed_tail.py, the history-resume marker joins test_dashboard_chat_history.py, and the stalled-reader tests join test_dashboard_chat_api_chat.py. test_dashboard_chat.py ends at 929 lines: TestRunChatTransientRetry with its shared harness, TestAcpProcessDiedRecovery's redaction tests, and TestRunChatModelFallback, which other test files import. Test bodies move unchanged except one docstring that names where TestRunChatModelFallback lives; the collected tests are the same set, and the cited locations follow the moved classes. Part of #20192
First Principles Review (Opus 5.5) — ⏭️ skippedRevision |
UX Review (Opus 5.5) — ⏭️ skippedRevision |
Design Review (Opus 5.5) — ✅ PASSDesign-level review of Design-Verdict: PASS Nothing to check. [DESIGN-REVIEWED] b52921b Description read[DESCRIPTION-READ] 9ce5410ce8a9554dc68296862906b4f7cbee38afc017984d844118e083906098 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.
Tier 1 auto-approve: test (14 files). Criteria: no conflict, no requested changes, security path denylist clean, design-doc gate clean, security checklist all-NO, no reviewer-lane findings, readiness signal fresh for this head SHA, declared category matches the diff. Category: splits test/test_dashboard_chat.py into topic files; test code moved, references updated, line-cap baseline entry dropped. Spec files changed as a ride-along (a minority of the diff on both file count and changed lines), not reviewed as a design decision: docs/system-specs/common/testing-conventions.md, docs/system-specs/modules/model-fallback.md.
Problem / Motivation
Goal: Move the last region of
test/test_dashboard_chat.pyinto topic test files, every test unchanged, so the file ends under the 2,000-line cap; part 6 of 6.After parts 1-5 (#20268, #20596, #20626, #20696, #20834),
test/test_dashboard_chat.pystill holds 3,586 lines, over the 2,000-line cap the line-cap campaign sets for hand-written files (#20192). Every chat feature PR edits the same file, so its PRs conflict with each other and nobody can find the tests for one behaviour.Why it matters
A test nobody can find gets duplicated or goes stale. One topic per file lets a chat PR touch only the files for the behaviour it changes, and keeps each file small enough for a reviewer to read in one pass. This part takes the file off the line-cap baseline, so the cap guards it from here on.
Not a goal
test_dashboard_chat_handlers_coverage.py,_pins.py,_rewind.py).What changed (motivation → approach → change)
Same recipe as parts 1-5: split by behaviour under test along the file's own classes and section banners, deleting one region of
test_dashboard_chat.pyso git's default diff shows the move as deletions (this one: 260 KB).test_dashboard_chat.pygoes from 3,586 to 929 lines and its row leaves.github/file-line-cap-baseline.txt.This PR deletes lines 934-3586 of this PR's base
test_dashboard_chat.py(the series base's lines 24195-26845), plus the three-line "Bulk model switch" banner at 349-351, which travels withTestBulkModelSwitch:test/test_dashboard_chat_model_pick.py(new)TestSlotProbeWrapsSharedRestoreBody,TestBulkModelSwitch,TestSlotModelGuardtest/test_dashboard_chat_model_live_switch.py(new)TestSlotModelLiveSwitch,TestSlotModelSwitchContextBroadcasttest/test_dashboard_chat_fork_tail.py(new)TestForkSlotTailtest/test_dashboard_chat_slot.py(extended)TestSlotsGetWarmsGitLabAllowlist,TestSourceLinkUrlsExcludeIssuestest/test_dashboard_chat_session_authority.py(extended)TestSessionReload,TestCloseBroadcastDurabilitytest/test_dashboard_chat_unflushed_tail.py(extended)TestUnflushedTailOrderingAndSnapshottest/test_dashboard_chat_history.py(extended)TestHistoryResumeInterruptedTurnMarkertest/test_dashboard_chat_api_chat.py(extended)TestApiChatStalledReaderEvery class moves whole and keeps its name.
test_dashboard_chat.pykeeps three classes:TestRunChatTransientRetry, with its thinking-only retry tests and the stream harness (_make_state,_wire_sessions,_client,_drain_bg) that five files reuse: the threetest_dashboard_chat_transient_*siblings,test_fallback_row_attribution_8560.pyandtest_turn_stats.py;TestAcpProcessDiedRecovery, with its two redaction tests and the harnesstest_dashboard_chat_provider_recovery.pyreuses;TestRunChatModelFallback, which other test files import.The module docstring now names those helpers so they stay bound in the file.
Backwards compatibility
Compatible: test-only, plus four citation edits in comments and docs.
test_dashboard_chat.pykeeps every name another test file imports from it (_provider_mock,TestRunChatTransientRetry,TestRunChatModelFallback,TestAcpProcessDiedRecovery). Node ids of moved tests change, because the file is part of the id; no expected-failure, symlink or collect-ignore list names any of them.Removes nothing: every test moves, the 918 collected tests are the same set, and no production code changes.
Tests
pytest --coovertest_dashboard_chat.pyat the series base (30bb0b3) and over it plus the 34 sibling test files at this head gives the same multiset of (class, test, parameters): 918 and 918. 91 node ids move file and none changes class. The 918 covers the series' 35 files; the three older siblings bring the fulltest_dashboard_chat*.pyglob to 1,183.-n0.test_source_pin_budget.py,test_flake_pattern_ratchet.py,test_wait_discipline_ratchet.py,test_ci_surface_tests.py,test_leaf_test_scope.py), plustest_autonudge.pyand the files whose comments this PR edits: 1,275 passed at-n 3. Each new or extended file also passes alone at-n0.p/python p/typescript p/security-audit p/secrets p/owasp-top-ten semgrep/ --baseline-commit) over the changed files: clean. flake8, isort and black: clean on every touched file.scripts/check_file_line_cap.py: 0 failures with the row removed. mypy is not re-run: no file undersrc/changes.Move audit
The changed units:
TestSlotProbeWrapsSharedRestoreBody. It saidTestRunChatModelFallbackwas "above"; it now saysTestRunChatModelFallback (test_dashboard_chat.py).git diffandgit diff --minimaladd the same lines for every changed file (test/test_dashboard_chat.py: 10 added, 2,667 deleted both ways), so no kept line shows as added.Justified edits and citations
test/test_dashboard_chat_model_live_switch.py,test/test_dashboard_chat_session_authority.py# flake-ok: <reason>above moved sleeps (5, with their# nosemgrep: kirocrew.test-sleep-as-barriermarkers) and above the threerelease_*.wait()parks inTestSlotModelLiveSwitch's concurrent-pick testsflake-okis the exemption thetests-are-deterministicrule lists, and the test bodies stay AST-identical. De-flaking them is #20377test/test_dashboard_chat_fork_tail.py# nosemgrep: kirocrew.test-autouse-shared-monkeypatchaboveTestForkSlotTail._tail_fork_enabled.github/file-line-cap-baseline.txttest/test_dashboard_chat.pyrow deleteddocs/system-specs/modules/model-fallback.mdTestSlotProbeWrapsSharedRestoreBodyintest/test_dashboard_chat_model_pick.pydocs/system-specs/common/testing-conventions.md,test/conftest.py,test/test_autonudge.pytest_dashboard_chat_session_authority.pyas the home ofTestCloseBroadcastDurabilityCI path references
None: no workflow path filter or explicit file list names
test/test_dashboard_chat.py.Manual verification
N/A — test-only move; the collection proof and the test runs above cover it.
Related Issues
Part of #20192
Follow-up: #20377 (pre-existing shapes moved verbatim; de-flake there)
Checklist
feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)