nextest
nextest copied to clipboard
Consider filling `message` attribute of `<failure>` element in junit report
An existing sonar rust plugin does not accept junit reports without message
attribute filled. So until bug is fixed on sonar rust side, maybe it is possible to fill message attribute on nextest
side. Possibly related PR with related work https://github.com/nextest-rs/nextest/pull/313.
Sounds reasonable. Would you like to contribute a PR to achieve that?
Thanks a lot you've taken a look at the issue. I've already dived into https://github.com/nextest-rs/nextest/blob/main/nextest-runner/src/reporter/aggregator.rs and it seems to me that proper extraction of message and backtrace (if present) separately is not currently implement and will require quite a bit of rework how test output is parsed. I might be wrong with estimation that this is non-trivial change. If you feel ready to implement it I'm not against, but in other case it's probably better to discuss in advance what kind of change is required to implement filling message.
I think we can just use the first line of the description returned here as the message: https://github.com/nextest-rs/nextest/blob/b3f8e565d6f9f06df15267432251ace40a717a60/nextest-runner/src/reporter/aggregator.rs#L273-L276
If it isn't present, something generic like "test failed" would be okay.
Going to mark this as "help wanted" and low-urgency since it looks like sonar has been fixed.