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
Created attachment 44568 [details] [review] Bug 15151: Make t/Circulation_barcodedecode.t pass Test plan: prove t/Circulation_barcodedecode.t should return green even if your DBMS is stopped.
Created attachment 44569 [details] [review] Bug 15151 [Alternate] - t/Circulation_barcodedecode.t fails if no DB present Test Plan: 1) Shut down database 2) prove t/Circulation_barcodedecode.t should fail 3) Apply this patch 4) prove t/Circulation_barcodedecode.t should not fail!
Created attachment 44570 [details] [review] 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
Created attachment 44571 [details] [review] Bug 15151 [Alternate] - t/Circulation_barcodedecode.t fails if no DB present Test Plan: 1) Shut down database 2) prove t/Circulation_barcodedecode.t should fail 3) Apply this patch 4) prove t/Circulation_barcodedecode.t should not fail!
Created attachment 44573 [details] [review] [SIGNED-OFF] 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>
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>
Passed all tests, code looks good.. go for it ;)
Patch pushed to master.
This patch has been pushed to 3.20.x, will be in 3.20.6.
Pushed to 3.18.13, and released.