Bug 15151 - t/Circulation_barcodedecode.t fails if no DB present
Summary: t/Circulation_barcodedecode.t fails if no DB present
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Test Suite (show other bugs)
Version: Main
Hardware: All All
: P5 - low blocker
Assignee: Chris Cormack
QA Contact: Galen Charlton
URL:
Keywords:
Depends on: 14778
Blocks: 13275 15182 15795
  Show dependency treegraph
 
Reported: 2015-11-06 13:41 UTC by Tomás Cohen Arazi (tcohen)
Modified: 2019-06-27 09:24 UTC (History)
8 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:


Attachments
Bug 15151: Make t/Circulation_barcodedecode.t pass (967 bytes, patch)
2015-11-06 14:35 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 15151 [Alternate] - t/Circulation_barcodedecode.t fails if no DB present (1.04 KB, patch)
2015-11-06 14:39 UTC, Kyle M Hall (khall)
Details | Diff | Splinter Review
Bug 15151: (counter patch) Avoid DB access to load C4::Members (4.78 KB, patch)
2015-11-06 14:40 UTC, Tomás Cohen Arazi (tcohen)
Details | Diff | Splinter Review
Bug 15151 [Alternate] - t/Circulation_barcodedecode.t fails if no DB present (1.09 KB, patch)
2015-11-06 14:41 UTC, Kyle M Hall (khall)
Details | Diff | Splinter Review
[SIGNED-OFF] Bug 15151: (counter patch) Avoid DB access to load C4::Members (4.85 KB, patch)
2015-11-06 14:59 UTC, Kyle M Hall (khall)
Details | Diff | Splinter Review
[PASSED QA] Bug 15151: (counter patch) Avoid DB access to load C4::Members (4.90 KB, patch)
2015-11-06 18:59 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Tomás Cohen Arazi (tcohen) 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 (khall) 2015-11-06 14:39:49 UTC Comment hidden (obsolete)
Comment 3 Tomás Cohen Arazi (tcohen) 2015-11-06 14:40:51 UTC Comment hidden (obsolete)
Comment 4 Kyle M Hall (khall) 2015-11-06 14:41:55 UTC Comment hidden (obsolete)
Comment 5 Kyle M Hall (khall) 2015-11-06 14:59:59 UTC Comment hidden (obsolete)
Comment 6 Martin Renvoize (ashimema) 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 (ashimema) 2015-11-06 19:00:52 UTC
Passed all tests, code looks good.. go for it ;)
Comment 8 Tomás Cohen Arazi (tcohen) 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.