Bug 19440: Identify overlimit problems in XISBN tests
authorTomas Cohen Arazi <tomascohen@theke.io>
Mon, 9 Oct 2017 18:36:41 +0000 (15:36 -0300)
committerFridolin Somers <fridolin.somers@biblibre.com>
Tue, 17 Oct 2017 07:00:31 +0000 (09:00 +0200)
commitaaf0d3dc474def89ffbb69548ebaf830109143b0
tree9aca64ed3de0fc8e0df327f64486124367bbad7b
parentc94e6606525ce9da003a99800ba46fe6e1967d47
Bug 19440: Identify overlimit problems in XISBN tests

This patch makes C4::XISBN::get_xisbns() return an errors hashref
including information of the failing fetches from xisbn services.

It tackles the situation of XISBN, which in some cases returns 'overlimit'
errors.

The patch makes the relevant functions check if the response->{stat} string
is 'ok' and returns the string in $errors otherwise.

This only happens when in list context. This allows to fix the randomly failing
tests while keeping the current behaviour.

All this code should be rewritten. It does the job bug doesn't have problems handling
or reoprting. This is just a band aid.

To test:
- Make sure
 k$ prove t/db_dependent/XISBN.t
=> SUCCESS :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit e90874241808354777cc1c27ad3ad106ffdc7cd4)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
C4/XISBN.pm
t/db_dependent/XISBN.t