rest-cljer icon indicating copy to clipboard operation
rest-cljer copied to clipboard

Better failure messages

Open mt3593 opened this issue 7 years ago • 0 comments

Hi @whostolebenfrog

This is more of a improvement than a issue, and is currently more of a thought and an action so would really appreciate your view on this.

So we've had issues understanding why rest-cljer fails, the logs are hard for a new person using the library to understand. It usually takes a week or so going over the output with people to educate how to read and interpret the issues they see.

My current way of teaching people to read the output is find the ClientDriverFailedExpectationException: 1 unexpected request(s): message to get the request and then find the 1 expectation(s): expected: 1, actual: 0 -> ClientDriverRequest: line to read the response. I'm glossing over some more detail here but i'm hoping some of this rings true for you?

Few thoughts on how we could make it more readable:

  • Extract out the logic for the comparison and on failure just output the request/s that failed and the unmatched expected requests.
  • Maybe incorporate why it fails each expected request rather than logging all the failures.
  • Add the expected request clojure representation to the output of the failure, rather than the toString of the function being output.

I've tried having a look at how to do these but I think the limitation is wrapping around the rest-client-driver and using the hamcrest matcher library. So maybe moving away from wrapping this library is the way forward but that kind of defeats the purpose of what this library is for.

Thoughts?

mt3593 avatar Feb 28 '18 10:02 mt3593