[Bug 15082] New: t/db_dependent/Search.t shouldn't mock the DB connection
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=15082 Bug ID: 15082 Summary: t/db_dependent/Search.t shouldn't mock the DB connection Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: normal Priority: P5 - low Component: Test Suite Assignee: chris@bigballofwax.co.nz Reporter: tomascohen@gmail.com QA Contact: gmcharlt@gmail.com DB-dependent tests don't need to mock the DB. Actually, this one is not using the mock at all, so we might be hiding side effects. It seems that as the configuration file is created on each test run, we just need to grab the DB configuration from C4::Context and use it in rewrite-config.PL to go un-mocked. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=15082 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Patch complexity|--- |Trivial patch Status|NEW |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=15082 --- Comment #1 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 44153 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=44153&action=edit 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 -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=15082 Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=15082 Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #44153|0 |1 is obsolete| | --- Comment #2 from Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> --- Created attachment 44161 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=44161&action=edit [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 -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=15082 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=15082 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #44161|0 |1 is obsolete| | --- Comment #3 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Created attachment 44169 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=44169&action=edit 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> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=15082 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|chris@bigballofwax.co.nz |tomascohen@gmail.com CC| |jonathan.druart@bugs.koha-c | |ommunity.org -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=15082 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to Master CC| |tomascohen@gmail.com --- Comment #4 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Patch pushed to master. -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org