Repository navigation
perf(test): reuse SMS test modules - #125151
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed August 17, 2026, 3:47 AM ET / 07:47 UTC. ClawSweeper reviewWhat this changesThe PR replaces per-test SMS module resets and dynamic imports with shared partial-real Vitest mocks and static owner-module imports, reducing test-suite setup cost. Merge readiness✅ Ready for maintainer review No blocking findings. This remains a useful test-only optimization: current main still rebuilds the SMS module graph per case, while the PR preserves the mocked transport and delivery boundaries with the repository’s established partial-real mock pattern. Priority: P3 Review scores
Verification
How this fits togetherThe bundled SMS plugin routes outgoing text and MMS through Twilio, records initial delivery observations, and exposes account status. The changed tests isolate those transport, media, status, and runtime boundaries while exercising the channel and send owners. flowchart LR
A[SMS test cases] --> B[Shared Vitest mocks]
B --> C[SMS channel and send owners]
C --> D[Twilio transport]
C --> E[Delivery and status boundaries]
D --> F[Behavior assertions]
E --> F
Before mergeNone. Agent review detailsSecurityNone. PR surfaceTests -12. Total -12 across 2 files. View PR surface stats
Review metrics
Technical reviewBest possible solution: Retain the shared mock setup and merge once the in-progress exact-head checks complete, preserving the existing per-case mock, environment, and timer resets. Do we have a high-confidence way to reproduce the issue? Not applicable: the PR optimizes test execution rather than fixing a reported user-facing defect; its body supplies focused, repeat-run, and suite-level validation results. Is this the best way to solve the issue? Yes. Reusing the loaded owner modules while resetting mutable mocks, timers, and environment per test removes repeated setup without changing the tested production boundaries. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 3b8f9fb5a2bb. 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
|
|
Land-ready proof for exact head
No proof gaps. No changelog: test-only change. |
|
Merged via squash.
|
What Problem This Solves
The 33 SMS test cases rebuilt the broad SMS SDK module graph for every case, making this focused suite slower and substantially more memory-hungry than the behavior under test required.
Why This Change Was Made
Hoist partial-real mocks and static owner-module imports so the suite reuses the expensive module graph. The partial-real boundaries preserve the real Twilio constants and status formatting, while each test still owns and resets its mocks, environment, and timers.
User Impact
There is no production or user-visible behavior change. Maintainers get faster, lower-memory SMS test feedback with the same assertions and isolation. This is test-only, so no changelog entry is needed.
Evidence