Repository navigation
test: split test_dashboard_chat.py, part 3 of 6 - #20626
Conversation
Move BASE lines 16811-18987 of test/test_dashboard_chat.py into topic siblings: TestForkSlot to test_dashboard_chat_fork.py and the four stop classes to test_dashboard_chat_stop.py; TestColorTheme joins test_dashboard_chat_session_meta.py and the installed-pack consent tests join test_dashboard_chat_prompt_prep.py. The AcpProcessDied section banner, which sits above the stop-during-preparation tests, stays with TestAcpProcessDiedRecovery. Two references follow moved code: test/prompts_helpers.py cites TestRunChatEarlyExitHandOff in its new file, and the session-teardown scan in test_dashboard_chat_token_usage.py also reads the chat_turn owners the runner composes, so a teardown site that moves there is still checked for its model-verdict reset. Test bodies move unchanged, and the collected tests are the same set. Part of #20192
First Principles Review (Opus 5.5) — ⏭️ skippedRevision |
Design Review (Opus 5.5) — ✅ PASSDesign-level review of Design-Verdict: PASS Check one thing: the [DESIGN-REVIEWED] 8b8fe6b Description read[DESCRIPTION-READ] 2369226f5d578f0190b52938ffee7c3c5bd16bab721024c23f389e4c10fe1c48 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 |
UX Review (Opus 5.5) — ⏭️ skippedRevision |
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 (8 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: moves dashboard chat tests from test_dashboard_chat.py into topic files, with the matching line-cap baseline drop and a test-only scan update; no source change.
Problem / Motivation
Goal: Move the third region of
test/test_dashboard_chat.pyinto topic test files, every test unchanged, as part 3 of the 6-PR series that brings the file under the 2,000-line cap.After parts 1 and 2 (#20268, #20596),
test/test_dashboard_chat.pystill holds 10,082 lines, five times 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.
Not a goal
TestAcpProcessDiedRecoveryrequeue tests with BASE lines 19620-21612, then theTestRunChatTransientRetrytopic classes, then 24195-26845. Each PR is published after the one before it merges.What changed (motivation → approach → change)
Same recipe as parts 1 and 2: 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: 196 KB).test_dashboard_chat.pygoes from 10,082 to 7,900 lines.This PR moves lines 37-2210 of this PR's base
test_dashboard_chat.py(the series base's lines 16811-18987). The three lines it keeps inside that span are theAcpProcessDied handlersection banner, which stays aboveTestAcpProcessDiedRecovery.test/test_dashboard_chat_fork.py(new)TestForkSlottest/test_dashboard_chat_stop.py(new)TestStopReasonCancelled,TestStopTurnSlotState,TestStopHistoryBanner,TestStopDuringSessionPreptest/test_dashboard_chat_session_meta.py(extended)TestColorThemetest/test_dashboard_chat_prompt_prep.py(extended)TestInstalledPackConsentInjectionEvery class moves whole and keeps its name. Two references follow code that moved:
test/prompts_helpers.pycitesTestRunChatEarlyExitHandOffintest_dashboard_chat_refusal.py, where part 2 put it.TestPinnedModelWithheld.test_every_session_teardown_drops_the_verdictalso scans thechat_turnowners that the runner composes (#20526), so a session-teardown site that moves there is still checked for its model-verdict reset.Backwards compatibility
Compatible: test-only.
test_dashboard_chat.pykeeps every name another test file imports from it (_provider_mock,TestRunChatTransientRetry,TestRunChatModelFallback). 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 26 sibling test files at this head gives the same multiset of (class, test, parameters): 918 and 918. No test changes class in this part.-n0.state.sessions.reset(...)with no verdict reset, appended to achat_turnowner, fails the edited test and passes the old one.test_source_pin_budget.pypasses withtest_dashboard_chat_token_usage.pystill at one source read.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, plus the files this PR edits): 1,213 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. mypy is not re-run: no file undersrc/changes.Move audit
The one changed unit is the module docstring, which says what the file still holds.
git diffandgit diff --minimaladd the same lines for every changed file (test/test_dashboard_chat.py: 4 added, 2,186 deleted both ways), so no kept line shows as added.Justified edits and citations
.github/file-line-cap-baseline.txttest/test_dashboard_chat.pyrow lowered from 10082 to 7900test/prompts_helpers.pytest/test_dashboard_chat_refusal.py::TestRunChatEarlyExitHandOfftest/test_dashboard_chat_token_usage.pykiro_crew/dashboard/chat_turn/*.py, counting runner-side sites across the runner and its ownerschat_runnernow composeschat_turnowners (#20526); a teardown that moves there would otherwise go uncheckedCI 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
Checklist
feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)