The routines DelSuggestionsOlderThan, CountSuggestion, ConnectSuggestionAndBiblio, SearchSuggestion, GetSuggestionInfo, DelSuggestion and GetSuggestionByStatus of the module C4::Suggestions.pm are not tested in t/db_dependent/Suggestions.t
Created attachment 28973 [details] [review] Bug 12445: Improving unit tests for C4::Suggestions.pm Now, the tests used 'is' instead of 'ok', the tests are wrapped in a transaction, adding tests for the routines NewSuggestion, GetSuggestion, ModSuggestion, GetSuggestionFromBiblionumber and GetInfoFromBiblionumber. The tests for the routines DelSuggestionsOlderThan, CountSuggestion, ConnectSuggestionAndBiblio, SearchSuggestion, GetSuggestionInfo, DelSuggestion and GetSuggestionByStatus will be arrived in another patch. Test plan: 1/ Execute the command : prove t/db_dependent/Suggestions.t 2/ The result has to be a success without warning or error : t/db_dependent/Suggestions.t .. ok All tests successful. Files=1, Tests=32, 2 wallclock secs ( 0.03 usr 0.01 sys + 1.49 cusr 0.08 csys = 1.61 CPU) Result: PASS
Created attachment 29041 [details] [review] Bug 12445: ading unit tests to test the routines : CountSuggestion, ConnectSuggestionAndBiblio, SearchSuggestion, GetSuggestionInfo, DelSuggestion, GetSuggestionByStatus These routines were not tested Test plan: 1/ Execute the command : prove t/db_dependent/Suggestions.t 2/ The result has to be a success without error or warning : t/db_dependent/Suggestions.t .. ok All tests successful. Files=1, Tests=89, 1 wallclock secs ( 0.05 usr 0.01 sys + 1.52 cusr 0.08 csys = 1.66 CPU) Result: PASS
I've applied against master 3.17.00.008 Everything was OK. So I've passed the patch to "Signed Off" status.
Created attachment 29103 [details] [review] Bug 12445: Improving unit tests for C4::Suggestions.pm
Created attachment 29104 [details] [review] Bug 12445: ading unit tests to test the routines : CountSuggestion, ConnectSuggestionAndBiblio, SearchSuggestion, GetSuggestionInfo, DelSuggestion, GetSuggestionByStatus
Suggestions.t passes on master. When I try with these patches applied I get this: perl t/db_dependent/Suggestions.t 1..89 ok 1 - use C4::Suggestions; ok 2 - use C4::Koha; DBD::mysql::db selectrow_array failed: MySQL server has gone away at /home/koha/kohaclone/C4/Context.pm line 563. DBD::mysql::db selectrow_array failed: MySQL server has gone away at /home/koha/kohaclone/C4/Context.pm line 563. # Looks like you planned 89 tests but ran 2. # Looks like your test exited with 255 just after 2.
Kyle, before launching this UT, have you configure your database with a database for test (see bz 10337) ?
(In reply to Kyle M Hall from comment #6) > Suggestions.t passes on master. When I try with these patches applied I get > this: > perl t/db_dependent/Suggestions.t > 1..89 > ok 1 - use C4::Suggestions; > ok 2 - use C4::Koha; > DBD::mysql::db selectrow_array failed: MySQL server has gone away at > /home/koha/kohaclone/C4/Context.pm line 563. > DBD::mysql::db selectrow_array failed: MySQL server has gone away at > /home/koha/kohaclone/C4/Context.pm line 563. > # Looks like you planned 89 tests but ran 2. > # Looks like your test exited with 255 just after 2. Since this error is linked to the bug 12472, I change the status to Needs Signed Off
Conflict to solve
Created attachment 29954 [details] [review] Bug 12445: Improving unit tests for C4::Suggestions.pm Now, the tests used 'is' instead of 'ok', the tests are wrapped in a transaction, adding tests for the routines NewSuggestion, GetSuggestion, ModSuggestion, GetSuggestionFromBiblionumber and GetInfoFromBiblionumber. The tests for the routines DelSuggestionsOlderThan, CountSuggestion, ConnectSuggestionAndBiblio, SearchSuggestion, GetSuggestionInfo, DelSuggestion and GetSuggestionByStatus will be arrived in another patch. Test plan: 1/ Execute the command : prove t/db_dependent/Suggestions.t 2/ The result has to be a success without warning or error : t/db_dependent/Suggestions.t .. ok All tests successful. Files=1, Tests=32, 2 wallclock secs ( 0.03 usr 0.01 sys + 1.49 cusr 0.08 csys = 1.61 CPU) Result: PASS Signed-off-by: Paola Rossi <paola.rossi@cineca.it>
Created attachment 29955 [details] [review] Bug 12445: ading unit tests to test the routines : CountSuggestion, ConnectSuggestionAndBiblio, SearchSuggestion, GetSuggestionInfo, DelSuggestion, GetSuggestionByStatus These routines were not tested Test plan: 1/ Execute the command : prove t/db_dependent/Suggestions.t 2/ The result has to be a success without error or warning : t/db_dependent/Suggestions.t .. ok All tests successful. Files=1, Tests=89, 1 wallclock secs ( 0.05 usr 0.01 sys + 1.52 cusr 0.08 csys = 1.66 CPU) Result: PASS Signed-off-by: Paola Rossi <paola.rossi@cineca.it>
Created attachment 30045 [details] [review] [SIGNED-OFF] Bug 12445: Improving unit tests for C4::Suggestions.pm Now, the tests used 'is' instead of 'ok', the tests are wrapped in a transaction, adding tests for the routines NewSuggestion, GetSuggestion, ModSuggestion, GetSuggestionFromBiblionumber and GetInfoFromBiblionumber. The tests for the routines DelSuggestionsOlderThan, CountSuggestion, ConnectSuggestionAndBiblio, SearchSuggestion, GetSuggestionInfo, DelSuggestion and GetSuggestionByStatus will be arrived in another patch. Test plan: 1/ Execute the command : prove t/db_dependent/Suggestions.t 2/ The result has to be a success without warning or error : t/db_dependent/Suggestions.t .. ok All tests successful. Files=1, Tests=32, 2 wallclock secs ( 0.03 usr 0.01 sys + 1.49 cusr 0.08 csys = 1.61 CPU) Result: PASS Signed-off-by: Paola Rossi <paola.rossi@cineca.it> Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Created attachment 30046 [details] [review] [SIGNED-OFF] Bug 12445: ading unit tests to test the routines : CountSuggestion, ConnectSuggestionAndBiblio, SearchSuggestion, GetSuggestionInfo, DelSuggestion, GetSuggestionByStatus These routines were not tested Test plan: 1/ Execute the command : prove t/db_dependent/Suggestions.t 2/ The result has to be a success without error or warning : t/db_dependent/Suggestions.t .. ok All tests successful. Files=1, Tests=89, 1 wallclock secs ( 0.05 usr 0.01 sys + 1.52 cusr 0.08 csys = 1.66 CPU) Result: PASS Signed-off-by: Paola Rossi <paola.rossi@cineca.it> Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> Test pass, no koha-qa errors But now there are 91! prove t/db_dependent/Suggestions.t t/db_dependent/Suggestions.t .. ok All tests successful. Files=1, Tests=91, 2 wallclock secs ( 0.05 usr 0.00 sys + 1.77 cusr 0.10 csys = 1.92 CPU) Result: PASS
I am sorry, tests fail on my database: t/db_dependent/Suggestions.t .. 1/91 DBD::mysql::db do failed: Cannot delete or update a parent row: a foreign key constraint fails (`koha`.`issues`, CONSTRAINT `issues_ibfk_1` FOREIGN KEY (`borrowernumber`) REFERENCES `borrowers` (`borrowernumber`) ON UPDATE CASCADE) at t/db_dependent/Suggestions.t line 39. DBD::mysql::db do failed: Cannot delete or update a parent row: a foreign key constraint fails (`koha`.`issues`, CONSTRAINT `issues_ibfk_1` FOREIGN KEY (`borrowernumber`) REFERENCES `borrowers` (`borrowernumber`) ON UPDATE CASCADE) at t/db_dependent/Suggestions.t line 39. # Looks like you planned 91 tests but ran 2. # Looks like your test exited with 255 just after 2. Can you add some clean up prior to running the tests and switch back to signed off?
Created attachment 30094 [details] [review] Bug 12445 [QA Followup] - Clear issues table before clearing borrrowers table
Created attachment 30096 [details] [review] Bug 12445: Improving unit tests for C4::Suggestions.pm Now, the tests used 'is' instead of 'ok', the tests are wrapped in a transaction, adding tests for the routines NewSuggestion, GetSuggestion, ModSuggestion, GetSuggestionFromBiblionumber and GetInfoFromBiblionumber. The tests for the routines DelSuggestionsOlderThan, CountSuggestion, ConnectSuggestionAndBiblio, SearchSuggestion, GetSuggestionInfo, DelSuggestion and GetSuggestionByStatus will be arrived in another patch. Test plan: 1/ Execute the command : prove t/db_dependent/Suggestions.t 2/ The result has to be a success without warning or error : t/db_dependent/Suggestions.t .. ok All tests successful. Files=1, Tests=32, 2 wallclock secs ( 0.03 usr 0.01 sys + 1.49 cusr 0.08 csys = 1.61 CPU) Result: PASS Signed-off-by: Paola Rossi <paola.rossi@cineca.it> Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Created attachment 30097 [details] [review] Bug 12445: ading unit tests to test the routines : CountSuggestion, ConnectSuggestionAndBiblio, SearchSuggestion, GetSuggestionInfo, DelSuggestion, GetSuggestionByStatus These routines were not tested Test plan: 1/ Execute the command : prove t/db_dependent/Suggestions.t 2/ The result has to be a success without error or warning : t/db_dependent/Suggestions.t .. ok All tests successful. Files=1, Tests=89, 1 wallclock secs ( 0.05 usr 0.01 sys + 1.52 cusr 0.08 csys = 1.66 CPU) Result: PASS Signed-off-by: Paola Rossi <paola.rossi@cineca.it> Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> Test pass, no koha-qa errors But now there are 91! prove t/db_dependent/Suggestions.t t/db_dependent/Suggestions.t .. ok All tests successful. Files=1, Tests=91, 2 wallclock secs ( 0.05 usr 0.00 sys + 1.77 cusr 0.10 csys = 1.92 CPU) Result: PASS Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Created attachment 30098 [details] [review] Bug 12445 [QA Followup] - Clear issues table before clearing borrrowers table Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
This one is ready to QA.
Created attachment 30166 [details] [review] [PASSED QA] Bug 12445: Improving unit tests for C4::Suggestions.pm Now, the tests used 'is' instead of 'ok', the tests are wrapped in a transaction, adding tests for the routines NewSuggestion, GetSuggestion, ModSuggestion, GetSuggestionFromBiblionumber and GetInfoFromBiblionumber. The tests for the routines DelSuggestionsOlderThan, CountSuggestion, ConnectSuggestionAndBiblio, SearchSuggestion, GetSuggestionInfo, DelSuggestion and GetSuggestionByStatus will be arrived in another patch. Test plan: 1/ Execute the command : prove t/db_dependent/Suggestions.t 2/ The result has to be a success without warning or error : t/db_dependent/Suggestions.t .. ok All tests successful. Files=1, Tests=32, 2 wallclock secs ( 0.03 usr 0.01 sys + 1.49 cusr 0.08 csys = 1.61 CPU) Result: PASS Signed-off-by: Paola Rossi <paola.rossi@cineca.it> Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com> Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Created attachment 30167 [details] [review] [PASSED QA] Bug 12445: ading unit tests to test the routines : CountSuggestion, ConnectSuggestionAndBiblio, SearchSuggestion, GetSuggestionInfo, DelSuggestion, GetSuggestionByStatus These routines were not tested Test plan: 1/ Execute the command : prove t/db_dependent/Suggestions.t 2/ The result has to be a success without error or warning : t/db_dependent/Suggestions.t .. ok All tests successful. Files=1, Tests=89, 1 wallclock secs ( 0.05 usr 0.01 sys + 1.52 cusr 0.08 csys = 1.66 CPU) Result: PASS Signed-off-by: Paola Rossi <paola.rossi@cineca.it> Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> Test pass, no koha-qa errors But now there are 91! prove t/db_dependent/Suggestions.t t/db_dependent/Suggestions.t .. ok All tests successful. Files=1, Tests=91, 2 wallclock secs ( 0.05 usr 0.00 sys + 1.77 cusr 0.10 csys = 1.92 CPU) Result: PASS Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com> Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Created attachment 30168 [details] [review] [PASSED QA] Bug 12445 [QA Followup] - Clear issues table before clearing borrrowers table Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com> Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de> All tests pass, even more now than before.
Patches pushed to master. Thanks Yohann!
Possible selection for 3.16.x
Pushed to 3.16.x, will be in 3.16.11