t/00-load.t should mock the DB connection.
Created attachment 33632 [details] [review] Bug 13274: t/00-load.t shouldn't depend on the DB To reproduce: - Stop your MySQL server: $ sudo service mysql stop - Run $ prove t/00-load.t => FAIL: some tests fail because of mysql stopped To test (MySQL still stopped) - Apply the patch - Run $ prove t/00-load.t => SUCCESS: tests pass because the ycan be loaded regardless of the absence of the DB server - Sign off :-D Regards
Created attachment 33636 [details] [review] [SIGNED OFF] Bug 13274: t/00-load.t shouldn't depend on the DB To reproduce: - Stop your MySQL server: $ sudo service mysql stop - Run $ prove t/00-load.t => FAIL: some tests fail because of mysql stopped To test (MySQL still stopped) - Apply the patch - Run $ prove t/00-load.t => SUCCESS: tests pass because the ycan be loaded regardless of the absence of the DB server - Sign off :-D NOTE: Even seems to grab more than expected, which is good. 349 tests in master vs 364 in this branch = 16, but removed block is only 13 (lines 20-32). Also ran koha-qa test tool. :) Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Created attachment 33638 [details] [review] [PASSED QA] Bug 13274: t/00-load.t shouldn't depend on the DB To reproduce: - Stop your MySQL server: $ sudo service mysql stop - Run $ prove t/00-load.t => FAIL: some tests fail because of mysql stopped To test (MySQL still stopped) - Apply the patch - Run $ prove t/00-load.t => SUCCESS: tests pass because the ycan be loaded regardless of the absence of the DB server - Sign off :-D NOTE: Even seems to grab more than expected, which is good. 349 tests in master vs 364 in this branch = 16, but removed block is only 13 (lines 20-32). Also ran koha-qa test tool. :) Signed-off-by: Mark Tompsett <mtompset@hotmail.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Works as described, tests passing now without database available.
Created attachment 33645 [details] [review] Bug 13274: Mock new_dbh in t::lib::Mocks This patch suggests to create a routine to mock C4::Context::_new_dbh.
Please have a look at the last patch. Maybe it would be better to create a routine in t::lib::Mocks to avoid to c/p theses lines in all related bugs.
Created attachment 33649 [details] [review] [SIGNED OFF] Bug 13274: Mock new_dbh in t::lib::Mocks This patch suggests to create a routine to mock C4::Context::_new_dbh. NOTE: Works the same with and without this secondary patch. koha-qa tests fine. Less cutting and pasting in the future. Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Patches pushed to master.