Bug 15151

Summary: t/Circulation_barcodedecode.t fails if no DB present
Product: Koha Reporter: Tomás Cohen Arazi <tomascohen>
Component: Test SuiteAssignee: Chris Cormack <chris>
Status: CLOSED FIXED QA Contact: Galen Charlton <gmcharlt>
Severity: blocker    
Priority: P5 - low CC: f.demians, jonathan.druart, katrin.fischer, kyle.m.hall, kyle, liz, m.de.rooy, martin.renvoize, tomascohen
Version: master   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Bug Depends on: 14778    
Bug Blocks: 13275, 15182, 15795    
Attachments: Bug 15151: Make t/Circulation_barcodedecode.t pass
Bug 15151 [Alternate] - t/Circulation_barcodedecode.t fails if no DB present
Bug 15151: (counter patch) Avoid DB access to load C4::Members
Bug 15151 [Alternate] - t/Circulation_barcodedecode.t fails if no DB present
[SIGNED-OFF] Bug 15151: (counter patch) Avoid DB access to load C4::Members
[PASSED QA] Bug 15151: (counter patch) Avoid DB access to load C4::Members

Description Tomás Cohen Arazi 2015-11-06 13:41:53 UTC
It should be mocking the DB, but...

To reproduce:
- Run the test:
  $ prove t/Circulation_barcodedecode.t
=> SUCCESS: Tests pass
- Shut mysql down
  $ sudo service mysql stop
- Run the test:
  $ prove t/Circulation_barcodedecode.t
=> FAIL: Tests fail due to missing DB connection
Comment 1 Jonathan Druart 2015-11-06 14:35:59 UTC Comment hidden (obsolete)
Comment 2 Kyle M Hall 2015-11-06 14:39:49 UTC Comment hidden (obsolete)
Comment 3 Tomás Cohen Arazi 2015-11-06 14:40:51 UTC Comment hidden (obsolete)
Comment 4 Kyle M Hall 2015-11-06 14:41:55 UTC Comment hidden (obsolete)
Comment 5 Kyle M Hall 2015-11-06 14:59:59 UTC Comment hidden (obsolete)
Comment 6 Martin Renvoize 2015-11-06 18:59:33 UTC
Created attachment 44604 [details] [review]
[PASSED QA] Bug 15151: (counter patch) Avoid DB access to load C4::Members

In order to avoid loading Koha::NorwegianPatronDB a DB query was
used. Instead, a require should be used. This causes non-db_dependent
tests that load C4::Members to fail.

To test:
- Shut mysql down
  $ sudo service mysql stop
- Run the tests:
  prove t/Circulation_barcodedecode.t
=> FAIL: DB connection is expected, tests fail
- Apply the patch
- Run the tests:
  prove t/Circulation_barcodedecode.t
=> SUCCESS: Tests pass
- Sign off .-D

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 7 Martin Renvoize 2015-11-06 19:00:52 UTC
Passed all tests, code looks good.. go for it ;)
Comment 8 Tomás Cohen Arazi 2015-11-08 16:10:58 UTC
Patch pushed to master.
Comment 9 Frédéric Demians 2015-11-29 20:35:06 UTC
This patch has been pushed to 3.20.x, will be in 3.20.6.
Comment 10 Liz Rea 2016-01-06 21:06:16 UTC
Pushed to 3.18.13, and released.