[Bug 16869] New: Silence and catch warnings in t/db_dependent/ SuggestionEngine_ExplodedTerms.t
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16869 Bug ID: 16869 Summary: Silence and catch warnings in t/db_dependent/SuggestionEngine_ExplodedTerms.t Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: minor Priority: P5 - low Component: Test Suite Assignee: mtompset@hotmail.com Reporter: mtompset@hotmail.com QA Contact: gmcharlt@gmail.com The warnings are triggered by a lack of opachtdocs, as the current mock function returns '', cascading C4::Template::themelanguage to fall through with no explicit return (turns out to be treated like '',undef,undef). This in turn sets the preferredtheme and lang to undef, which triggers the use of uninitialized values warning. While trying to figure out the best way to fix this, bug 8846 was discovered. Attempting to unset $KOHA_CONF triggers warnings, because of the "use C4::Context;" in C4::Languages and C4::Templates. prove t/db_dependent/SuggestionEngine_ExplodedTerms.t can reproduce the noise easily. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16869 M. Tompsett <mtompset@hotmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff Patch complexity|--- |Small patch -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16869 --- Comment #1 from M. Tompsett <mtompset@hotmail.com> --- Created attachment 53160 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=53160&action=edit Bug 16869: Silence and catch warnings in t/db_dependent/SuggestionEngine_ExplodedTerms.t By properly defining a opachtdocs (intranethtdocs was done too) in the mock function, uninitialized variable warnings are eliminated. Given that we can check if $KOHA_CONF is defined or not, we can catch the warning as part of testing, so the output of the test is cleaner. TEST PLAN --------- 1) unset KOHA_CONF 2) prove t/db_dependent/SuggestionEngine_ExplodedTerms.t -- lots of noise 3) apply patch 4) prove t/db_dependent/SuggestionEngine_ExplodedTerms.t -- no noise 5) prove -v t/db_dependent/SuggestionEngine_ExplodedTerms.t -- see the warnings were caught and not just ignored. 6) run koha qa test tools -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16869 Héctor Eduardo Castro Avalos <hector.hecaxmmx@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #53160|0 |1 is obsolete| | --- Comment #2 from Héctor Eduardo Castro Avalos <hector.hecaxmmx@gmail.com> --- Created attachment 53168 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=53168&action=edit [SIGNED-OFF]Bug 16869: Silence and catch warnings in t/db_dependent/SuggestionEngine_ExplodedTerms.t By properly defining a opachtdocs (intranethtdocs was done too) in the mock function, uninitialized variable warnings are eliminated. Given that we can check if $KOHA_CONF is defined or not, we can catch the warning as part of testing, so the output of the test is cleaner. TEST PLAN --------- 1) unset KOHA_CONF 2) prove t/db_dependent/SuggestionEngine_ExplodedTerms.t -- lots of noise 3) apply patch 4) prove t/db_dependent/SuggestionEngine_ExplodedTerms.t -- no noise 5) prove -v t/db_dependent/SuggestionEngine_ExplodedTerms.t -- see the warnings were caught and not just ignored. 6) run koha qa test tools Signed-off-by: Hector Castro <hector.hecaxmmx@gmail.com> No warnings. Works as advertised -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16869 Héctor Eduardo Castro Avalos <hector.hecaxmmx@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |hector.hecaxmmx@gmail.com Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16869 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16869 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #53168|0 |1 is obsolete| | --- Comment #3 from Kyle M Hall <kyle@bywatersolutions.com> --- Created attachment 53169 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=53169&action=edit Bug 16869: Silence and catch warnings in t/db_dependent/SuggestionEngine_ExplodedTerms.t By properly defining a opachtdocs (intranethtdocs was done too) in the mock function, uninitialized variable warnings are eliminated. Given that we can check if $KOHA_CONF is defined or not, we can catch the warning as part of testing, so the output of the test is cleaner. TEST PLAN --------- 1) unset KOHA_CONF 2) prove t/db_dependent/SuggestionEngine_ExplodedTerms.t -- lots of noise 3) apply patch 4) prove t/db_dependent/SuggestionEngine_ExplodedTerms.t -- no noise 5) prove -v t/db_dependent/SuggestionEngine_ExplodedTerms.t -- see the warnings were caught and not just ignored. 6) run koha qa test tools Signed-off-by: Hector Castro <hector.hecaxmmx@gmail.com> No warnings. Works as advertised Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16869 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to Master CC| |kyle@bywatersolutions.com --- Comment #4 from Kyle M Hall <kyle@bywatersolutions.com> --- Pushed to master for 16.11, thanks Mark! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16869 Frédéric Demians <frederic@tamil.fr> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to Master |Pushed to Stable CC| |frederic@tamil.fr --- Comment #5 from Frédéric Demians <frederic@tamil.fr> --- Pushed in 16.05. Will be in 16.05.02. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16869 Julian Maurice <julian.maurice@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |julian.maurice@biblibre.com --- Comment #6 from Julian Maurice <julian.maurice@biblibre.com> --- Patch pushed to 3.22.x, will be in 3.22.10 -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org