rspec_junit_formatter icon indicating copy to clipboard operation
rspec_junit_formatter copied to clipboard

Replace invalid characters with a placeholder

Open JohnFinn000 opened this issue 1 year ago • 2 comments

It seems that when tests print an emoji in the failure reason rspec_junit_formatter fails and prints the xml its already generated to that point which ends up being invalid because it creates an xml element with a missing closing brackets and that cannot be parsed by the tools that attempt to read it.

This fix causes invalid characters to be replaced with ??invalid?? instead of bailing out immediately. rspec_junit_formatter shouldn't output invalid xml regardless of the failures it encounters along the way.

This should fix this issue: https://github.com/sj26/rspec_junit_formatter/issues/92

JohnFinn000 avatar Feb 26 '24 19:02 JohnFinn000

This would be useful 👍🏼

hdost avatar May 29 '24 16:05 hdost

Tested this on our CI, fixed similar error with invalid XML.

Unknown-Guy avatar Jun 04 '24 15:06 Unknown-Guy