goss-org / goss

Quick and Easy server testing/validation
https://goss.rocks
Apache License 2.0
5.53k stars 470 forks source link

improve handling of errors in encoded TestResults #788

Closed ripienaar closed 1 year ago

ripienaar commented 1 year ago

Go error does not marshal to a string and cannot be unmarshalled but the TestResult has a error in it and is being marshalled by StructuredResult.

Here we create a basic string based error implementation that goes to json and back cleanly but we make sure tests for err==nil continues to work.

Signed-off-by: R.I.Pienaar rip@devco.net