nextest icon indicating copy to clipboard operation
nextest copied to clipboard

Consider filling `message` attribute of `<failure>` element in junit report

Open mstyura opened this issue 1 year ago • 4 comments

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.

mstyura avatar Sep 15 '23 21:09 mstyura

Sounds reasonable. Would you like to contribute a PR to achieve that?

sunshowers avatar Sep 21 '23 00:09 sunshowers

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.

mstyura avatar Sep 21 '23 12:09 mstyura

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.

sunshowers avatar Sep 25 '23 01:09 sunshowers

Going to mark this as "help wanted" and low-urgency since it looks like sonar has been fixed.

sunshowers avatar Nov 19 '23 23:11 sunshowers