If no patron category 'S' is defined, t/dbdependent/Budgets.t fails.
To reproduce make sure you have no category type 'S' defined but for example 'ST' instead. Failing: t/db_dependent/Budgets.t *) line 583 t/db_dependent/Passwordrecovery.t *) line 55 t/db_dependent/Members.t *) line 53 *) Test scipts with line"my $categorycode = 'S'; Passing: t/db_dependent/Suggestions.t lines 70 and following create a category 'S' if it does not exist.
We should use TestBuilder here to create the categories we need.
Created attachment 62090 [details] [review] Bug 18420: Fix Budgets.t when no patron category 'S' exists No need to create Staff users here. Test plan: prove t/db_dependent/Budgets.t should return green, even if no categories.categorycode 'S' exists
Created attachment 62091 [details] [review] Bug 18420: Fix Passwordrecovery.t when no patron category 'S' exists No need to create Staff users here. Test plan: prove t/db_dependent/Passwordrecovery.t should return green, even if no categories.categorycode 'S' exists
Created attachment 62092 [details] [review] Bug 18420: Fix Members.t when no patron category 'S' exists No need to create Staff users here. Test plan: prove t/db_dependent/Members.t should return green, even if no categories.categorycode 'S' exists
Created attachment 62093 [details] [review] Bug 18420: Use TestBuilder to create a patron category in Suggestions.t No need to do it that way, let's use TestBuilder. Test plan: prove t/db_dependent/Suggestions.t should still return green
There are much more left.
Created attachment 62095 [details] [review] Bug 18420: Do not use 'S' as patron category code in other tests Test plan: prove all these tests, they must all pass
Problem with: $ prove t/db_dependent/Acquisition/OrderUsers.t t/db_dependent/Acquisition/OrderUsers.t .. DBD::mysql::st execute failed: Cannot add or update a child row: a foreign key constraint fails (`koha_kohadev`.`aqorders`, CONSTRAINT `aqorders_currency` FOREIGN KEY (`currency`) REFERENCES `currency` (`currency`) ON DELETE SET NULL ON UPDATE SET NULL) [for Statement "INSERT INTO `aqorders` ( `basketno`, `biblionumber`, `budget_id`, `currency`, `ecost`, `entrydate`, `ordernumber`, `orderstatus`, `quantity`, `quantityreceived`, `rrp`) VALUES ( ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )" with ParamValues: 0='7', 1='15', 2='51', 3='EUR', 4=10, 5='01-01-2014', 6=undef, 7=1, 8=2, 9=0, 10=10] at /usr/share/perl5/DBIx/Class/Storage/DBI.pm line 1832. DBIx::Class::Storage::DBI::_dbh_execute(): Cannot add or update a child row: a foreign key constraint fails (`koha_kohadev`.`aqorders`, CONSTRAINT `aqorders_currency` FOREIGN KEY (`currency`) REFERENCES `currency` (`currency`) ON DELETE SET NULL ON UPDATE SET NULL) at /home/marc/koha/Koha/Acquisition/Order.pm line 50
Problem with: prove t/db_dependent/Holds/LocalHoldsPriority.t t/db_dependent/Holds/LocalHoldsPriority.t .. 1/6 Odd number of elements in anonymous hash at t/db_dependent/Holds/LocalHoldsPriority.t line 60. Odd number of elements in anonymous hash at t/db_dependent/Holds/LocalHoldsPriority.t line 60. Odd number of elements in anonymous hash at t/db_dependent/Holds/LocalHoldsPriority.t line 60. Odd number of elements in anonymous hash at t/db_dependent/Holds/LocalHoldsPriority.t line 60. Odd number of elements in anonymous hash at t/db_dependent/Holds/LocalHoldsPriority.t line 60. DBD::mysql::st execute failed: Cannot add or update a child row: a foreign key constraint fails (`koha_kohadev`.`reserves`, CONSTRAINT `reserves_ibfk_1` FOREIGN KEY (`borrowernumber`) REFERENCES `borrowers` (`borrowernumber`) ON DELETE CASCADE ON UPDATE CASCADE) [for Statement "INSERT INTO `reserves` ( `biblionumber`, `branchcode`, `expirationdate`, `found`, `itemnumber`, `itemtype`, `priority`, `reservedate`, `reservenotes`, `waitingdate`) VALUES ( ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )" with ParamValues: 0='45', 1='B', 2=undef, 3=undef, 4=undef, 5=undef, 6=1, 7='2017-04-12', 8='', 9=undef] at /usr/share/perl5/DBIx/Class/Storage/DBI.pm line 1832. DBIx::Class::Storage::DBI::_dbh_execute(): Cannot add or update a child row: a foreign key constraint fails (`koha_kohadev`.`reserves`, CONSTRAINT `reserves_ibfk_1` FOREIGN KEY (`borrowernumber`) REFERENCES `borrowers` (`borrowernumber`) ON DELETE CASCADE ON UPDATE CASCADE) at /home/marc/koha/Koha/Object.pm line 121
Created attachment 62115 [details] [review] Bug 18420: Do not use 'S' as patron category code in other tests Test plan: prove all these tests, they must all pass
t/db_dependent/Acquisition/OrderUsers.t passes for me. Does it pass for you on master?
(In reply to Jonathan Druart from comment #12) > t/db_dependent/Acquisition/OrderUsers.t passes for me. > Does it pass for you on master? I tested on a fresh install I made when testing the onboarding tool. Ahh, fails both with and without patches.
(In reply to Marc Véron from comment #10) > Problem with: > prove t/db_dependent/Holds/LocalHoldsPriority.t (...) Test passes OK with newest patch
(In reply to Marc Véron from comment #13) > (In reply to Jonathan Druart from comment #12) > > t/db_dependent/Acquisition/OrderUsers.t passes for me. > > Does it pass for you on master? > > I tested on a fresh install I made when testing the onboarding tool. > > Ahh, fails both with and without patches. It seemed that the failing test did not roll back the database, so I restored original VM with install mentioned above. OK, found: t/db_dependent/Acquisition/OrderUsers.t line 51 uses EUR as currency but currencies were not yet defined. Applied patches, created currency EUR, prove t/db_dependent/Acquisition/OrderUsers.t, turns green.
t/db_dependent/Budgets.t (Wstat: 2304 Tests: 142 Failed: 9) Failed tests: 30, 44-50, 60 Non-zero exit status: 9
Created attachment 62118 [details] [review] Bug 18420: Replace hardcoded EUR in OrderUsers.t
(In reply to Marcel de Rooy from comment #16) > t/db_dependent/Budgets.t (Wstat: 2304 Tests: 142 Failed: 9) > Failed tests: 30, 44-50, 60 > Non-zero exit status: 9 t/db_dependent/Budgets.t .. 1/142 DBD::mysql::db do failed: Cannot delete or update a parent row: a foreign key constraint fails (`koha_master`.`vendor_edi_accounts`, CONSTRAINT `vfk_shipment_budget` FOREIGN KEY (`shipment_budget`) REFERENCES `aqbudgets` (`budget_id`)) [for Statement "DELETE FROM aqbudgets"] at t/db_dependent/Budgets.t line 25. Obviously, this problem also exists without these patches..
Re-testing on current master 16.12.00.024 Database dropped and recreated. Run through install, mandatory data only. No user, library etc. created. Applied patches Restart plack Testing prove t/db_dependent/Budgets.t OK prove t/db_dependent/Passwordrecovery.t FAIL (branchcode undefined) prove t/db_dependent/Members.t OK prove t/db_dependent/Suggestions.t OK prove t/db_dependent/Acquisition/OrderUsers.t OK prove t/db_dependent/Circulation.t OK prove t/db_dependent/Circulation/IsItemIssued.t OK prove t/db_dependent/Circulation/IssuingRules/maxsuspensiondays.t OK prove t/db_dependent/Holds/HoldFulfillmentPolicy.t FAIL 1/10 Can't use an undefined value as an ARRAY reference at t/db_dependent/Holds/HoldFulfillmentPolicy.t line 41. prove t/db_dependent/Holds/HoldItemtypeLimit.t OK prove t/db_dependent/Holds/LocalHoldsPriority.t OK prove t/db_dependent/Holds/RevertWaitingStatus.t OK prove t/db_dependent/Members/Attributes.t OK prove t/db_dependent/Patron/Borrower_Debarments.t OK prove t/db_dependent/Patron/Borrower_Files.t OK prove t/db_dependent/Serials_2.t OK
Created attachment 62164 [details] [review] Bug 18420: Fix HoldFulfillmentPolicy.t and Passwordrecovery.t We are going out of scope here, but these tests need a branch/item. Test plan: Run the adjusted tests. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Marc, could you signoff? I will pass QA after that. Further problems not strictly related to the bug theme, we should move to a new report. A few fixes are strictly out of scope already..
Created attachment 62174 [details] [review] Bug 18420: Fix Budgets.t when no patron category 'S' exists No need to create Staff users here. Test plan: prove t/db_dependent/Budgets.t should return green, even if no categories.categorycode 'S' exists Signed-off-by: Marc Véron <veron@veron.ch>
Created attachment 62175 [details] [review] Bug 18420: Fix Passwordrecovery.t when no patron category 'S' exists No need to create Staff users here. Test plan: prove t/db_dependent/Passwordrecovery.t should return green, even if no categories.categorycode 'S' exists Signed-off-by: Marc Véron <veron@veron.ch>
Created attachment 62176 [details] [review] Bug 18420: Fix Members.t when no patron category 'S' exists No need to create Staff users here. Test plan: prove t/db_dependent/Members.t should return green, even if no categories.categorycode 'S' exists Signed-off-by: Marc Véron <veron@veron.ch>
Created attachment 62177 [details] [review] Bug 18420: Use TestBuilder to create a patron category in Suggestions.t No need to do it that way, let's use TestBuilder. Test plan: prove t/db_dependent/Suggestions.t should still return green Signed-off-by: Marc Véron <veron@veron.ch>
Created attachment 62178 [details] [review] Bug 18420: Do not use 'S' as patron category code in other tests Test plan: prove all these tests, they must all pass Signed-off-by: Marc Véron <veron@veron.ch>
Created attachment 62179 [details] [review] Bug 18420: Replace hardcoded EUR in OrderUsers.t Signed-off-by: Marc Véron <veron@veron.ch>
Created attachment 62180 [details] [review] Bug 18420: Fix HoldFulfillmentPolicy.t and Passwordrecovery.t We are going out of scope here, but these tests need a branch/item. Test plan: Run the adjusted tests. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Marc Véron <veron@veron.ch>
Created attachment 62274 [details] [review] Bug 18420: Fix Budgets.t when no patron category 'S' exists No need to create Staff users here. Test plan: prove t/db_dependent/Budgets.t should return green, even if no categories.categorycode 'S' exists Signed-off-by: Marc Véron <veron@veron.ch> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Created attachment 62275 [details] [review] Bug 18420: Fix Passwordrecovery.t when no patron category 'S' exists No need to create Staff users here. Test plan: prove t/db_dependent/Passwordrecovery.t should return green, even if no categories.categorycode 'S' exists Signed-off-by: Marc Véron <veron@veron.ch> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Created attachment 62276 [details] [review] Bug 18420: Fix Members.t when no patron category 'S' exists No need to create Staff users here. Test plan: prove t/db_dependent/Members.t should return green, even if no categories.categorycode 'S' exists Signed-off-by: Marc Véron <veron@veron.ch> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Created attachment 62277 [details] [review] Bug 18420: Use TestBuilder to create a patron category in Suggestions.t No need to do it that way, let's use TestBuilder. Test plan: prove t/db_dependent/Suggestions.t should still return green Signed-off-by: Marc Véron <veron@veron.ch> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Created attachment 62278 [details] [review] Bug 18420: Do not use 'S' as patron category code in other tests Test plan: prove all these tests, they must all pass Signed-off-by: Marc Véron <veron@veron.ch> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Created attachment 62279 [details] [review] Bug 18420: Replace hardcoded EUR in OrderUsers.t Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Marc Véron <veron@veron.ch>
Created attachment 62280 [details] [review] Bug 18420: Fix HoldFulfillmentPolicy.t and Passwordrecovery.t We are going out of scope here, but these tests need a branch/item. Test plan: Run the adjusted tests. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Marc Véron <veron@veron.ch>
I saw a failure on Circulation.t once (Subtest: CanBookBeIssued + AllowMultipleIssuesOnABiblio), but could not reproduce it. But it is not related to this bug anyhow.
Pushed to master for 17.05, thanks Jonathan, Marcel!
I am having some problems with applying acd91afd0c623e75ea9f9d7fb3b57a39bdfb1890 Can you please check and rebase?
Still having problems, please rebase! Applying: Bug 18420: Do not use 'S' as patron category code in other tests Using index info to reconstruct a base tree... M t/db_dependent/Acquisition/OrderUsers.t M t/db_dependent/Circulation.t M t/db_dependent/Holds/HoldFulfillmentPolicy.t M t/db_dependent/Holds/HoldItemtypeLimit.t Falling back to patching base and 3-way merge... Auto-merging t/db_dependent/Holds/HoldItemtypeLimit.t Auto-merging t/db_dependent/Holds/HoldFulfillmentPolicy.t Auto-merging t/db_dependent/Circulation.t CONFLICT (content): Merge conflict in t/db_dependent/Circulation.t
2 months, no reply. Closing this. Please reopen with rebased patches if you think this should be included in 16.11.x.
Created attachment 112053 [details] [review] Bug 18420: Fix HoldFulfillmentPolicy.t and Passwordrecovery.t We are going out of scope here, but these tests need a branch/item. Test plan: Run the adjusted tests. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Marc Véron <veron@veron.ch> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>