Repository navigation
test(ui): split the oversized cron view suite to unbreak main - #127018
Conversation
`main` is red: `check-lint-core-5` fails with
ui/src/pages/cron/view.test.ts
1124:4 error File has too many lines (1004). eslint(max-lines)
The file has been growing for a while (1104 lines at fa75cdd, 1116 at
2acfc47) and crossed the 1000 code-line cap at a4b3f63 (#126945). Every
PR opened since inherits the failure, so this is not any one PR's fault to fix
in passing -- it blocks the merge gate for everyone.
Repo policy forbids a `max-lines` suppression, so the file is split along the
seam it already had: three top-level describes, one of which was two thirds of
the file. `cron view editor` moves to `view.editor.test.ts`; `cron view list
pane` and `cron view selects` stay in `view.test.ts`. The four DOM helpers the
blocks shared move into the existing `view.test-support.ts` sibling rather than
being duplicated, and each file imports only what it uses.
No test content changed: 42 tests before, 42 after, same 41 `it(` declarations.
Sizes drop to 373 / 721 / 143 lines, all well under the cap.
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed August 21, 2026, 12:58 AM ET / 04:58 UTC. ClawSweeper reviewWhat this changesSplits the Control UI cron view tests into list/select and editor suites, moving shared DOM assertions into the existing cron test-support module to restore the file-size lint gate. Regression provenancePossible regression — probable (reviewed change; failure trace). No predecessor PR is attributed. Merge readinessKeep open for normal maintainer merge handling: the test-only split is mechanically sound and current main still has the oversized suite, but exact-head checks are incomplete and the required structured autoreview could not start in this environment. Priority: P2 Review scores
Verification
Live VerificationCommand: Result: PASS (completed) Assertions:
How this fits togetherThe Control UI cron renderer displays automation list, editor, and schedule controls; colocated Vitest suites exercise those views through shared fixtures. This PR reorganizes that test boundary without changing the served UI or gateway behavior. flowchart LR
A[Automation fixtures] --> B[Cron view renderer]
B --> C[List and select tests]
B --> D[Editor tests]
C --> E[Shared test helpers]
D --> E
C --> F[Vitest and lint gates]
D --> F
Decision needed
Why: The maintainer label requires explicit human handling, while no product or API direction remains unresolved. Before merge
Agent review detailsSecurityNone. PR surfaceSource +43, Tests -30. Total +13 across 3 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Keep the minimal test-only relocation and merge after a clean PR-scoped autoreview plus exact-head required checks. Do we have a high-confidence way to reproduce the issue? Yes — current main’s 1,124-line test file is covered by the 1,000-code-line UI-test lint rule, matching the reported failing boundary; this read-only review did not execute lint locally. Is this the best way to solve the issue? Yes — splitting at the existing editor describe boundary and reusing the already-shared support fixture is cleaner than a forbidden max-lines suppression or duplicate helpers. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 1fb4857e3cc2. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
|
Merged via squash.
|
…aw#127018) `main` is red: `check-lint-core-5` fails with ui/src/pages/cron/view.test.ts 1124:4 error File has too many lines (1004). eslint(max-lines) The file has been growing for a while (1104 lines at b7ec570, 1116 at ed40a7d) and crossed the 1000 code-line cap at 4310d65 (openclaw#126945). Every PR opened since inherits the failure, so this is not any one PR's fault to fix in passing -- it blocks the merge gate for everyone. Repo policy forbids a `max-lines` suppression, so the file is split along the seam it already had: three top-level describes, one of which was two thirds of the file. `cron view editor` moves to `view.editor.test.ts`; `cron view list pane` and `cron view selects` stay in `view.test.ts`. The four DOM helpers the blocks shared move into the existing `view.test-support.ts` sibling rather than being duplicated, and each file imports only what it uses. No test content changed: 42 tests before, 42 after, same 41 `it(` declarations. Sizes drop to 373 / 721 / 143 lines, all well under the cap.
What Problem This Solves
mainis red.check-lint-core-5fails on every run, including runs onmainitself (for example run 32447829557 at9bc772ba506):Every PR opened since inherits the failure, so the merge gate is blocked repo-wide. I hit it landing an unrelated core change and traced it rather than assuming it was mine — my own files lint clean.
The file has been drifting toward the cap for a while, and the reported count is code lines, not physical:
fa75cdd01cc(#126718)2acfc47b7fe(#126962)a4b3f63a872(#126945)It crossed 1000 code lines at
a4b3f63a872, which is where CI went red.Why This Change Was Made
Repo policy is explicit that a
max-linessuppression is not an option — existing ones are grandfathered TODOs, and new ones are forbidden. So the file gets split.It already had the seam. Three top-level describes, one of which was roughly two thirds of the file:
cron view list paneview.test.tscron view editorview.editor.test.tscron view selectsview.test.tsThe four DOM helpers (
getButtonByText,getElement,selectSegmented,findToggleByLabel) were local to the test file and used from more than one block. Rather than duplicate them across the two files, they move into the existingview.test-support.tssibling that already holdscreateCronViewJobandrenderCronView— the file that exists for exactly this. Each test file then imports only the helpers it actually uses, which is why the two import lists differ.No test content, ordering, or assertion changed. This is a pure relocation.
User Impact
None at runtime.
check-lint-core-5goes green, which unblocks the merge gate for every open PR.Evidence
Test parity, before and after:
it(declarationsorigin/main)File sizes now 373 / 721 / 143 lines, all comfortably under the 1000 cap.
oxlint --config .oxlintrc.json ui/src/pages/cron/— exit 0, no findings across the whole directory (the first pass caught three unused imports from the mechanical split; those were trimmed rather than suppressed).oxfmt --check ui/src/pages/cron/*.ts— all 19 files correctly formatted.node scripts/run-vitest.mjs ui/src/pages/cron/view.test.ts ui/src/pages/cron/view.editor.test.ts— 2 files, 42 passed,rc=0.