You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(core): expand --trace dump with per-case spans, heap counter, and metadata
Why: phase summary already conveys macro-level timings, but Perfetto UI is
underused at the file level — every test file shows up as 8 phase blocks
with no visibility into which case or hook dominates `tests`. Add detail
that surfaces in Perfetto without touching `runner.ts`.
- Emit per-case and per-suite `ph: 'X'` slices (cats `case` / `suite`)
via the runner's existing `RunnerHooks` lifecycle callbacks; `runner.ts`
is untouched. `TestCaseInfo.startTime` provides the case start time,
suite start is captured at hook firing.
- Sample `process.memoryUsage()` as `ph: 'C'` counter events at every
phase boundary so heap pressure shows up as Perfetto tracks
(heapUsedMB / heapTotalMB / rssMB).
- Add `process_sort_index` and `thread_name` metadata per pid so the UI
lists test files in execution order under a "worker" label.
- Delete previous-session trace JSON on each finalize so watch mode
doesn't accumulate multi-MB files under `.rstest/`.
Refactor: collapse `types/trace.ts`, `utils/traceController.ts`, and
`utils/traceServer.ts` into a single `utils/trace.ts`. The split was
incidental, the call sites all consume the same surface, and a single
file makes the public-vs-internal boundary obvious.
When `--trace` is off, the new methods early-return on a single
`if (!this.trace)` check; the no-trace path stays allocation-free aside
from the existing `PhaseTimings` totals object used by phase summary.
0 commit comments