fix(test): two dashboard-api reds — conversions changed the log CHANNEL and the error MESSAGE - #2774
Conversation
|
Warning Review limit reached
Next review available in: 7 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Greptile SummaryThe PR updates SSE logging tests to follow the shared logger’s
Confidence Score: 5/5The PR appears safe to merge. No blocking failure remains; the previous console-spy leak is fixed by unconditional cleanup in the describe block’s afterEach hook.
|
| Filename | Overview |
|---|---|
| packages/dashboard/src/tests/sse.test.ts | Updates SSE logger assertions and safely restores the describe block’s per-test console spies after every test. |
Reviews (3): Last reviewed commit: "test(dashboard): restore console spies i..." | Re-trigger Greptile
|
Already done on this branch — this looks like a re-report against an earlier revision.
The reasoning is recorded at the hook, including the part that makes this worth fixing rather than a style nit: these spy The hook also covers any case added to that describe later, which the per-test restore could not. |
…HANNEL and the MESSAGE
Both red on main; api:curated 2 failed -> 34 files / 1599 passed.
1. sse.test.ts spied `console.log`. `sseDebug` routes through `createLogger("sse").debug`
(sse.ts:50-53) and the shared logger writes debug lines to console.ERROR with a
`\0fnlvl=info\0` severity marker — that is the point of FN-8603's adapter. The spy saw nothing
and the failure read "expected false to be true", naming neither the channel nor the logger.
2. routes-tasks asserted the substring "in-review or in-progress". The message is now built from
RESOLVED lanes and quotes each one — `[...prFeedbackReviewColumns, prFeedbackWipColumn]
.map((c) => `'${c}'`).join(" or ")` (register-task-workflow-routes.ts:5969) — so it reads
`'in-review' or 'in-progress'`.
Asserted each lane separately rather than re-pinning the joined string: the join order and
separator are presentation, while the lanes being the resolved review + wip columns is the fact
this case owns. Re-pinning the punctuation would break again on the next formatting change and
would not have caught a wrong lane.
Neither is a product defect — both are conversions the tests had not followed. Lint clean, dashboard
tsc clean.
Fusion-Task-Id: U9
…ptile P2) Correct, and my change made the leak worse rather than introducing it. A failing assertion skips the trailing `mockRestore()`, leaving the console mocked for every later test in the file — and since these now spy `console.error`, which is where the shared logger writes ALL diagnostics, the leak silences exactly the output needed to debug the failure that caused it. Both cases in the describe had that shape (the `console.log` sibling too), so the restore moved into the existing `afterEach` alongside the FUSION_DEBUG restore, and the two trailing manual calls are gone. The hook also covers any case added later, which the per-test form never did. MEASURED — forced a failure past where the old manual restore sat: before: the spy would remain installed for the rest of the file after: 1 failed | 23 passed, no cascade — later cases still see console.error as shipped: 24 passed; api:curated 34 files / 1599 passed Lint clean. Fusion-Task-Id: U9
a0f5b70 to
27a6e01
Compare
Both red on main.
api:curatedgoes 2 failed → 34 files / 1599 passed. Neither is a product defect — both are conversions the tests had not followed.1. The log channel moved
sse.test.tsspiedconsole.log.sseDebugroutes throughcreateLogger("sse").debug(sse.ts:50-53), and the shared logger writes debug lines toconsole.errorcarrying a\0fnlvl=info\0severity marker — that is the point of FN-8603's adapter.So the spy saw nothing, and the failure read
expected false to be true, naming neither the channel nor the logger. The stderr in the run output showed the lines being emitted the whole time:2. The error message is now built from resolved lanes
routes-tasksasserted the substring"in-review or in-progress". The message is now:so it reads
'in-review' or 'in-progress'— quoted, and derived from the resolved columns.Asserted each lane separately rather than re-pinning the joined string. The join order and separator are presentation; the lanes being the resolved review + wip columns is the fact this case owns. Re-pinning the punctuation would break again on the next formatting change and would not have caught a wrong lane — which is the failure this test exists to catch on a renamed board.
Verification
test:quality:api:curatedsse.test.tsroutes-tasks.test.tspnpm lint, dashboardtscScope
Fix-forward only, per the u9 lane. Found by re-scanning the packages after #2739 / #2744 / #2754 merged, rather than by waiting for a report.
For the record on the other groups at the same commit:
components-a1195 passed, core is 2 failed — both already accounted for (archived-column-gate-parityis #2768's target,agent-logs-and-monitor.pgis the deferred funnel/analytics decision on #2669).