| Summary: | Debug REST API tests | ||
|---|---|---|---|
| Product: | Koha | Reporter: | Jonathan Druart <jonathan.druart> |
| Component: | Test Suite | Assignee: | Jonathan Druart <jonathan.druart> |
| Status: | In Discussion --- | QA Contact: | Testopia <testopia> |
| Severity: | enhancement | ||
| Priority: | P5 - low | CC: | martin.renvoize, nick, tomascohen |
| Version: | unspecified | ||
| Hardware: | All | ||
| OS: | All | ||
| See Also: | https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25504 | ||
| GIT URL: | Initiative type: | --- | |
| Sponsorship status: | --- | Crowdfunding goal: | 0 |
| Patch complexity: | --- | Documentation contact: | |
| Documentation submission: | Text to go in the release notes: | ||
| Version(s) released in: | Circulation function: | ||
| Attachments: |
Bug 27190: [DO NOT PUSH] example of failure
Bug 27190: Test::Mojo - Always warn the error string on error |
||
Created attachment 114313 [details] [review] Bug 27190: [DO NOT PUSH] example of failure Apply patches from 18729 to test this change. Created attachment 114314 [details] [review] Bug 27190: Test::Mojo - Always warn the error string on error That's pretty ugly, and we will certainly never push it. But at least I will remember next time I need it, hopefully! (In reply to Jonathan Druart from comment #3) > That's pretty ugly, and we will certainly never push it. But at least I will > remember next time I need it, hopefully! Should we close then? (In reply to Katrin Fischer from comment #4) > (In reply to Jonathan Druart from comment #3) > > That's pretty ugly, and we will certainly never push it. But at least I will > > remember next time I need it, hopefully! > > Should we close then? I don't think so. It's still useful for debugging purpose and we should have something similar in master. |
It can be tricky to debug REST API tests. You can get a "received 500 when 200 expected", but you don't have the error. There is one manual way to do it: $t->put_ok($url)->status_is(200)->json_is($expected_json)->or( sub { warn $t->tx->res->to_string }); But could we provide a generic way to add a diag in case Test::Mojo fails?