Repository navigation
Remove single-test discovery copies - #6631
Conversation
|
Warning Review limit reached
Next review available in: 16 minutes Limit details: You’ve used all 3 included reviews currently available under your plan. 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: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (6)
Comment |
Greptile SummaryThis PR removes redundant collection copies along the discovery-to-execution path and adds fast paths for single-test discovery and tests without dependencies.
Confidence Score: 5/5The PR appears safe to merge with no concrete correctness or security regressions identified. The optimized collection paths preserve current caller contracts, dependency population ordering, deferred expansion behavior, lifecycle registration, and reporting visibility.
|
| Filename | Overview |
|---|---|
| src/TUnit.Engine/Building/TestBuilderPipeline.cs | Adds zero- and single-metadata fast paths while preserving per-metadata failed-test synthesis and caller-compatible result semantics. |
| src/TUnit.Engine/TestDiscoveryService.cs | Materializes the final filtered collection once as a List and exposes that concrete ownership through TestDiscoveryResult. |
| src/TUnit.Engine/Framework/TestRequestHandler.cs | Removes the execution-time array copy and passes the discovery result list directly to the coordinator. |
| src/TUnit.Engine/TestSessionCoordinator.cs | Executes against the supplied list directly; deferred expansion mutates it before all lifecycle and scheduling consumers, with no retained external observer. |
| src/TUnit.Engine/Building/TestBuilder.cs | Skips allocating traversal sets when the fully resolved test has no dependencies. |
| src/TUnit.Engine/Interfaces/ITestExecutor.cs | Narrows the internal execution contract from IEnumerable to List to express the mutable collection required by deferred expansion. |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart LR
A[Test metadata] --> B[TestBuilderPipeline]
B -->|zero items| C[Empty result]
B -->|one item| D[Build directly]
B -->|multiple items| E[Parallel build and flatten]
C --> F[TestDiscoveryService]
D --> F
E --> F
F --> G[Filter and register]
G --> H[Pass concrete List directly]
H --> I[Expand deferred placeholders]
I --> J[Prepare lifecycle and schedule]
Reviews (1): Last reviewed commit: "perf(engine): remove single-test copies" | Re-trigger Greptile
Code reviewReviewed the diff (6 files, +28/-10) plus the surrounding call sites in
All changes are internal-only (no public API surface, no source-generator output), so the CLAUDE.md dual-mode/snapshot-testing requirements don't apply here. Nit (non-blocking): the |
Carries the discovery List directly into execution, directly builds one metadata item, and skips empty dependency HashSets. 31 paired runs: TUnit session median 114.994 ms to 113.208 ms (-1.786 ms, -1.55%); paired delta -1.469 ms. Validation: deferred expansion 11 passed; dependency path 2; filtered discovery 1; reflection 1.