cargo2junit icon indicating copy to clipboard operation
cargo2junit copied to clipboard

Nightly cargo doc-test outputs `"type": "report"`, which causes panic

Open arpadav opened this issue 1 month ago • 1 comments

My command in CICD:

cargo +nightly test --doc --workspace --features doc-tests -- -Z unstable-options --report-time --format json

Here is an example output

// ... a lot of "type": "test" before this
{ "type": "suite", "event": "ok", "passed": 66, "failed": 0, "ignored": 0, "measured": 0, "filtered_out": 0, "exec_time": 0.230763199 }
{ "type": "report", "total_time": 0.887385934, "compilation_time": 0.647808005 }

And this line:

https://github.com/johnterickson/cargo2junit/blob/d854116f859116578907eb7f25d007a9bb17629c/src/main.rs#L171

Causes a panic.

I am not sure what is best practice, to just add Event::Report, or to silently continue and ignore unknown event types, etc.?

I would love to put in a PR if design guidance is given. Let me know, thank you

arpadav avatar Oct 28 '25 15:10 arpadav

could possibly just soften the logic to not panic on unknown events

danieleades avatar Oct 30 '25 13:10 danieleades