Skip to content

[cargo-nextest] add a store export-chrome-trace command#3163

Merged
sunshowers merged 1 commit into
mainfrom
export-chrome-trace
Mar 15, 2026
Merged

[cargo-nextest] add a store export-chrome-trace command#3163
sunshowers merged 1 commit into
mainfrom
export-chrome-trace

Conversation

@sunshowers

Copy link
Copy Markdown
Member

Export data in the Chrome event trace format, suitable for importing into Perfetto and other viewers.

@sunshowers sunshowers requested a review from Copilot March 15, 2026 20:34
@sunshowers sunshowers force-pushed the export-chrome-trace branch from c2e1f8b to 4df389f Compare March 15, 2026 20:37

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new cargo nextest store export-chrome-trace subcommand that converts recorded run events into Chrome Trace Event Format JSON for visualization in Perfetto / chrome://tracing, plus supporting runner-side conversion logic and snapshot tests.

Changes:

  • Introduce nextest-runner::record::convert_to_chrome_trace with grouping + JSON formatting options.
  • Wire up cargo nextest store export-chrome-trace (including CLI parsing, archive/store support, and error/exit-code mapping).
  • Add snapshot and unit tests validating emitted trace structure (pause/resume gaps, retries/flows, counters, etc.).

Reviewed changes

Copilot reviewed 10 out of 11 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
nextest-runner/src/record/chrome_trace.rs New converter from recorded events → Chrome trace JSON, with extensive tests.
nextest-runner/src/record/mod.rs Add module + re-export converter API/types.
nextest-runner/src/record/display.rs Factor run-id prefix highlighting into shared Styles helpers.
nextest-runner/src/record/AGENTS.md Document Chrome trace export behavior and invariants.
nextest-runner/src/errors.rs Add ChromeTraceError error type.
cargo-nextest/src/dispatch/utility/store.rs Add store export-chrome-trace subcommand implementation + CLI options.
cargo-nextest/src/errors.rs Map Chrome trace export errors to ExpectedError + exit codes.
cargo-nextest/src/dispatch/core/tests.rs Add CLI argument parsing coverage for new subcommand/options.
nextest-runner/src/record/snapshots/*.snap Add insta snapshots for trace output (basic/pause-resume/slot-mode).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

Comment thread nextest-runner/src/record/chrome_trace.rs Outdated
Comment thread nextest-runner/src/record/chrome_trace.rs Outdated
Comment thread nextest-runner/src/record/chrome_trace.rs Outdated
Comment thread nextest-runner/src/record/chrome_trace.rs
Comment thread nextest-runner/src/record/chrome_trace.rs
@codecov

codecov Bot commented Mar 15, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 23.38710% with 95 lines in your changes missing coverage. Please review.
✅ Project coverage is 85.12%. Comparing base (8966706) to head (8a1b20d).
⚠️ Report is 4 commits behind head on main.

Files with missing lines Patch % Lines
cargo-nextest/src/dispatch/utility/store.rs 1.12% 88 Missing ⚠️
cargo-nextest/src/errors.rs 0.00% 5 Missing ⚠️
nextest-runner/src/record/display.rs 93.33% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3163      +/-   ##
==========================================
+ Coverage   84.62%   85.12%   +0.49%     
==========================================
  Files         156      157       +1     
  Lines       43838    46067    +2229     
==========================================
+ Hits        37100    39214    +2114     
- Misses       6738     6853     +115     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@sunshowers sunshowers force-pushed the export-chrome-trace branch 2 times, most recently from 9846397 to b320c52 Compare March 15, 2026 21:00
Export data in the Chrome event trace format, suitable for importing into
Perfetto and other viewers.
@sunshowers sunshowers force-pushed the export-chrome-trace branch from b320c52 to 8a1b20d Compare March 15, 2026 21:03
@sunshowers sunshowers merged commit c6f1a8d into main Mar 15, 2026
21 checks passed
@sunshowers sunshowers deleted the export-chrome-trace branch March 15, 2026 21:21
@trunk-io

trunk-io Bot commented Mar 15, 2026

Copy link
Copy Markdown

Static BadgeStatic BadgeStatic BadgeStatic Badge

View Full Report ↗︎Docs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants