Summary: | t/db_dependent/Search.t shouldn't mock the DB connection | ||
---|---|---|---|
Product: | Koha | Reporter: | Tomás Cohen Arazi (tcohen) <tomascohen> |
Component: | Test Suite | Assignee: | Tomás Cohen Arazi (tcohen) <tomascohen> |
Status: | CLOSED FIXED | QA Contact: | Galen Charlton <gmcharlt> |
Severity: | normal | ||
Priority: | P5 - low | CC: | jonathan.druart, tomascohen |
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: | |||
Attachments: |
Bug 15082: t/db_dependent/Search.t shouldn't mock the DB connection
[SIGNED-OFF] Bug 15082: t/db_dependent/Search.t shouldn't mock the DB connection Bug 15082: t/db_dependent/Search.t shouldn't mock the DB connection |
Description
Tomás Cohen Arazi (tcohen)
2015-10-29 14:20:34 UTC
Created attachment 44153 [details] [review] Bug 15082: t/db_dependent/Search.t shouldn't mock the DB connection This patch makes the t/db_dependent/Search.t tests use a real DB instead of mocking the DB handler (which is not actually used and generates unnecesary warnings when running the tests). It does so by grabbing the DB configuration data using C4::Context->config() and passing it (writing %ENV) to rewrite-config.PL, all is done in zebra_config.pl which is only used on the Search.t file. To test: - Run $ prove t/db_dependent/Search.t => FAIL: Warnings are raised about DB being mocked and DBIC not recognising 'Mock' as a valid DB driver. - Apply the patch - Run $ prove r/db_dependent/Search.t => SUCCESS: Same tests results, no warning about DBIC driver. - Sign off :-D Disclamer: As of writing this patch, the Search.t tests pass. The patch is not dealing with tests results, but how they use the DB. Sponsored-by: Universidad Nacional de Cordoba Created attachment 44161 [details] [review] [SIGNED-OFF] Bug 15082: t/db_dependent/Search.t shouldn't mock the DB connection This patch makes the t/db_dependent/Search.t tests use a real DB instead of mocking the DB handler (which is not actually used and generates unnecesary warnings when running the tests). It does so by grabbing the DB configuration data using C4::Context->config() and passing it (writing %ENV) to rewrite-config.PL, all is done in zebra_config.pl which is only used on the Search.t file. To test: - Run $ prove t/db_dependent/Search.t => FAIL: Warnings are raised about DB being mocked and DBIC not recognising 'Mock' as a valid DB driver. - Apply the patch - Run $ prove r/db_dependent/Search.t => SUCCESS: Same tests results, no warning about DBIC driver. - Sign off :-D Disclamer: As of writing this patch, the Search.t tests pass. The patch is not dealing with tests results, but how they use the DB. Sponsored-by: Universidad Nacional de Cordoba Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> Test pass before & after, a 'little' less noisy No errors Created attachment 44169 [details] [review] Bug 15082: t/db_dependent/Search.t shouldn't mock the DB connection This patch makes the t/db_dependent/Search.t tests use a real DB instead of mocking the DB handler (which is not actually used and generates unnecesary warnings when running the tests). It does so by grabbing the DB configuration data using C4::Context->config() and passing it (writing %ENV) to rewrite-config.PL, all is done in zebra_config.pl which is only used on the Search.t file. To test: - Run $ prove t/db_dependent/Search.t => FAIL: Warnings are raised about DB being mocked and DBIC not recognising 'Mock' as a valid DB driver. - Apply the patch - Run $ prove r/db_dependent/Search.t => SUCCESS: Same tests results, no warning about DBIC driver. - Sign off :-D Disclamer: As of writing this patch, the Search.t tests pass. The patch is not dealing with tests results, but how they use the DB. Sponsored-by: Universidad Nacional de Cordoba Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> Test pass before & after, a 'little' less noisy No errors Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Patch pushed to master. |