Repository navigation
test: split test_dashboard_chat.py, part 4 of 6 - #20696
Conversation
UX Review (Opus 5.5) — ⏭️ skippedRevision |
Design Review (Opus 5.5) — ✅ PASSDesign-level review of Design-Verdict: PASS Check that the [DESIGN-REVIEWED] 392e127 Description read[DESCRIPTION-READ] 56dffa5c9421c124dfef191055cece27daac3b89697b0de2a6954c9ef5260ce4 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 |
First Principles Review (Opus 5.5) — ✅ PASSPremise-level review of First-Principles-Verdict: PASS Verify that CI collects the same 918 tests. The aliased What this change shipsInventory (6 items) — 6 justifiedIntent: shrink
[FIRST-PRINCIPLES-REVIEWED] 392e127 Description read[DESCRIPTION-READ] b81f1aea6d20c89c108bb322397e9a460cc73938f46f2f3ae05cd1a3bea5cc6e That sha256 names the PR description this verdict read. 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: |
TestAcpProcessDiedRecovery's requeue, retry-budget, stop and counter tests become TestAcpProcessDiedRecoveryRequeue in test_dashboard_chat_provider_recovery.py, which reuses the class's helpers through an underscore-aliased import. Its two partial-text redaction tests stay in test_dashboard_chat.py with the helpers: their fake-key fixtures must not become added lines. BASE lines 19620-21612 move as well: TestEmptyResponseRetry with TestProductiveTurnNeverReplaysVerbatim and TestEmptyTurnDiagnostics to test_dashboard_chat_empty_response.py, the ladder tests as TestEmptyResponseRetryLadder to test_dashboard_chat_empty_response_ladder.py, and TestExpandDollarSkills to test_dashboard_chat_prompt_prep.py. Test bodies move unchanged except TestProductiveTurnNeverReplaysVerbatim's docstring, which names the ladder class it no longer sits beside. The collected tests are the same set, and chat_utils.py's comment names the new home of the stop-reason pin. Part of #20192
b12c7e0 to
392e127
Compare
|
self-added: no
|
|
|
|
KiroCrewCaptain
left a comment
There was a problem hiding this comment.
Tier 1 auto-approve: test (7 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_dashboard_chat.py into four files; the only non-test edits are a comment pointer and the line-cap baseline.
Problem / Motivation
Goal: Move the fourth region of
test/test_dashboard_chat.pyinto topic test files, every test unchanged, as part 4 of the 6-PR series that brings the file under the 2,000-line cap.After parts 1-3 (#20268, #20596, #20626),
test/test_dashboard_chat.pystill holds 7,900 lines, almost four 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
TestRunChatTransientRetrytopic classes, then BASE lines 24195-26845. Each PR is published after the one before it merges.src/line touched is a comment.What changed (motivation → approach → change)
Same recipe as parts 1-3: split by behaviour under test along the file's own classes and section banners, so git's default diff shows the move as deletions (this one: 239 KB).
test_dashboard_chat.pygoes from 7,900 to 5,365 lines.This PR deletes lines 66-2668 of this PR's base
test_dashboard_chat.py(the series base'sTestAcpProcessDiedRecoveryrequeue tests and lines 19620-21612), except two kept tests at 184-231 and 431-451:test/test_dashboard_chat_provider_recovery.py(extended)TestAcpProcessDiedRecoveryRequeue:TestAcpProcessDiedRecovery's requeue, retry-budget, stop and counter teststest/test_dashboard_chat_empty_response.py(new)TestEmptyResponseRetry(harness and first-retry tests),TestProductiveTurnNeverReplaysVerbatim,TestEmptyTurnDiagnosticstest/test_dashboard_chat_empty_response_ladder.py(new)TestEmptyResponseRetryLaddertest/test_dashboard_chat_prompt_prep.py(extended)TestExpandDollarSkillsTestAcpProcessDiedRecoveryandTestEmptyResponseRetryare each larger than one class may be, so their later groups become topic classes. The topic classes reuse the source class's helpers through an underscore-aliased import (from test_dashboard_chat import TestAcpProcessDiedRecovery as _AcpDiedSuiteandfrom test_dashboard_chat_empty_response import TestEmptyResponseRetry as _EmptyRetrySuite) and_x = _Suite._xlines that keep each member's runtime kind; the alias keeps pytest from collecting the borrowed class twice.TestAcpProcessDiedRecoverykeeps its helpers and its two partial-text redaction tests intest_dashboard_chat.py, because their fake-key fixtures must not become added lines.Backwards compatibility
Compatible: test-only, plus one comment.
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 28 sibling test files at this head gives the same multiset of (class, test, parameters): 918 and 918, with each topic class mapped back to its source class. 43 node ids change class name under the<Class><Topic>rule:TestAcpProcessDiedRecovery->TestAcpProcessDiedRecoveryRequeue(22) andTestEmptyResponseRetry->TestEmptyResponseRetryLadder(21); every other moved test keeps its class.-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): 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: the onlysrc/change is a comment.Move audit
The changed units: the module docstring, which says what the file still holds, and one docstring sentence in
TestProductiveTurnNeverReplaysVerbatim. It said the ladder tests sit "beside them"; it now names the class they live in,TestEmptyResponseRetryLadder.git diffandgit diff --minimaladd the same lines for every changed file (test/test_dashboard_chat.py: 4 added, 2,539 deleted both ways), so no kept line shows as added.Justified edits and citations
test/test_dashboard_chat_empty_response.pyTestProductiveTurnNeverReplaysVerbatimdocstring: "the ladder tests beside them" -> "the ladder tests inTestEmptyResponseRetryLadder"test/test_dashboard_chat_provider_recovery.py# flake-ok: <reason>above the movedasyncio.wait(...)rendezvous inTestAcpProcessDiedRecoveryRequeue.test_output_reports_irreversible_consumption_before_turn_endflake-okis the exemption thetests-are-deterministicreview rule lists, and the test body stays AST-identical. De-flaking it is #20377src/kiro_crew/dashboard/chat_utils.py_STOP_END_TURNcomment namestest_dashboard_chat_empty_response.pyas the file that pins the mirrored stop reasonsTestEmptyTurnDiagnostics, which holds that pin, moved.github/file-line-cap-baseline.txttest/test_dashboard_chat.pyrow lowered from 7900 to 5365TestEmptyTurnDiagnosticsmoves with its"/home/someone/secret.txt"test literal verbatim: the same placeholder shape has passedinternal-content-scanon merged PRs.CI 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: ...)