Bug 12782

Summary: t/db_dependent/XISBN.t should work on DOM too
Product: Koha Reporter: Tomás Cohen Arazi (tcohen) <tomascohen>
Component: Test SuiteAssignee: Chris Cormack <chris>
Status: CLOSED FIXED QA Contact: Jonathan Druart <jonathan.druart>
Severity: normal    
Priority: P5 - low CC: jonathan.druart
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: Trivial patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:
Bug Depends on:    
Bug Blocks: 28288    
Attachments: Bug 12782: t/db_dependent/XISBN.t fails in DOM setup
Bug 12782: (followup) skip tests that fail because of provider's error
Bug 12782: t/db_dependent/XISBN.t fails in DOM setup
Bug 12782: (followup) skip tests that fail because of provider's error
Bug 12782: t/db_dependent/XISBN.t fails in DOM setup
Bug 12782: (followup) skip tests that fail because of provider's error

Description Tomás Cohen Arazi (tcohen) 2014-08-18 19:52:34 UTC
The current Mock_SimpleSearch sub always returns usmarc data. This will conflict with _get_biblio_from_xisbn, that calls C4::Search::new_record_from_zebra, so it expects MARCXML data on DOM.
Comment 1 Tomás Cohen Arazi (tcohen) 2014-08-18 20:08:41 UTC Comment hidden (obsolete)
Comment 2 Tomás Cohen Arazi (tcohen) 2014-08-18 20:25:55 UTC Comment hidden (obsolete)
Comment 3 Chris Cormack 2014-08-19 09:06:49 UTC Comment hidden (obsolete)
Comment 4 Chris Cormack 2014-08-19 09:07:06 UTC Comment hidden (obsolete)
Comment 5 Jonathan Druart 2014-08-20 11:18:00 UTC
Created attachment 31020 [details] [review]
Bug 12782: t/db_dependent/XISBN.t fails in DOM setup

To test:
- Have a DOM setup
- Run
  $ prove -v t/db_dependent/XISBN.t
=> FAIL: Can't call method "field" on an undefined value at .... C4/Search.pm ...
- Apply the patch
- Run
  $ prove -v t/db_dependent/XISBN.t
=> SUCCESS: Tests pass.
- Sign off

Regards
To+

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Comment 6 Jonathan Druart 2014-08-20 11:18:31 UTC
Created attachment 31021 [details] [review]
Bug 12782: (followup) skip tests that fail because of provider's error

It seems that XISBN is failing sometimes, if you run the tests a couple
of times in a row. An error 500 is raised by lwp.

This problem should be trapped and related tests skipped. Because too much
noise could make people pay no attention to this tests failing.

To reproduce:
- Run the tests several consecutive times:
  $ prove -v t/db_dependent/XISBN.t
=> FAIL: XISBN test will fail eventually, printing a networking-related warning.
- Apply the patch
- Repeat the test
=> SUCCESS: when XISBN the networking/connection refused problem arises, the test
  is skipped, and it still passes.

Regards
To+

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Comment 7 Tomás Cohen Arazi (tcohen) 2014-08-20 15:29:49 UTC
Patches pushed to master.