[Bug 10683] New: CRUD routines in C4::Circulation need unit tests
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10683 Bug ID: 10683 Summary: CRUD routines in C4::Circulation need unit tests Change sponsored?: --- Product: Koha Version: unspecified Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: Test Suite Assignee: gmcharlt@gmail.com Reporter: kenza.zaki@biblibre.com QA Contact: testopia@bugs.koha-community.org Unit tests for Add*, Get* and Del* routines in C4::Circulation.pm -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10683 kenza <kenza.zaki@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|gmcharlt@gmail.com |kenza.zaki@biblibre.com -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10683 kenza <kenza.zaki@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |ASSIGNED CC| |kenza.zaki@biblibre.com -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10683 kenza <kenza.zaki@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on| |10681 -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10683 kenza <kenza.zaki@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10683 --- Comment #1 from kenza <kenza.zaki@biblibre.com> --- Created attachment 20689 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=20689&action=edit Bug 10683: CRUD routines in C4::Circulation need unit tests This patch adds some unit tests wrap in a transaction for C4::Circulation.pm. Circulation_Branch.t adds tests for routines which deal with branch_item_rules,branch_borrower_circ_rules, default_branch_circ_rules, default_circ_rules, default_branch_item_rules in the database. Circulation_issue.t adds tests for routines which deal with accountline and issues in the database. NOTE: Some commented tests have to be fixed, and some tests can be added.More, other routines of Circulation.pm are tested in the patches: 10692 UT: Routines about transfers in Circulation.pm need unit tests 10710 UT : OfflineOperation's routines in C4/Circulation.t need unit tests 10767 UT: Routines which interact with the table issuingrules in C4/Circulation need unit test Test plan: prove t/db_dependent/Circulation_issue.t t/db_dependent/Circulation_issue.t .. ok All tests successful. Files=1, Tests=16, 0 wallclock secs ( 0.02 usr 0.00 sys + 0.40 cusr 0.02 csys = 0.44 CPU) Result: PASS prove t/db_dependent/Circulation_Branch.t t/db_dependent/Circulation_Branch.t .. ok All tests successful. Files=1, Tests=10, 2 wallclock secs ( 0.06 usr 0.00 sys + 1.02 cusr 0.06 csys = 1.14 CPU) Result: PASS -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10683 kenza <kenza.zaki@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |10795 -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10683 Jonathan Druart <jonathan.druart@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jonathan.druart@biblibre.co | |m -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10683 Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #20689|0 |1 is obsolete| | --- Comment #2 from Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> --- Created attachment 20747 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=20747&action=edit [SIGNED-OFF] Bug 10683: CRUD routines in C4::Circulation need unit tests This patch adds some unit tests wrap in a transaction for C4::Circulation.pm. Circulation_Branch.t adds tests for routines which deal with branch_item_rules,branch_borrower_circ_rules, default_branch_circ_rules, default_circ_rules, default_branch_item_rules in the database. Circulation_issue.t adds tests for routines which deal with accountline and issues in the database. NOTE: Some commented tests have to be fixed, and some tests can be added.More, other routines of Circulation.pm are tested in the patches: 10692 UT: Routines about transfers in Circulation.pm need unit tests 10710 UT : OfflineOperation's routines in C4/Circulation.t need unit tests 10767 UT: Routines which interact with the table issuingrules in C4/Circulation need unit test Test plan: prove t/db_dependent/Circulation_issue.t t/db_dependent/Circulation_issue.t .. ok All tests successful. Files=1, Tests=16, 0 wallclock secs ( 0.02 usr 0.00 sys + 0.40 cusr 0.02 csys = 0.44 CPU) Result: PASS prove t/db_dependent/Circulation_Branch.t t/db_dependent/Circulation_Branch.t .. ok All tests successful. Files=1, Tests=10, 2 wallclock secs ( 0.06 usr 0.00 sys + 1.02 cusr 0.06 csys = 1.14 CPU) Result: PASS Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> Comment: Well, I don't know exactly what to do with this, so I left it to QA a) prove t/db_dependent/Circulation_Branch.t works well and without erros b) prove t/db_dependent/Circulation_issue.t works without errors for me ONLY if I have a issuingrule for All, All with 1 as renewals allowed, in other cases it fails. No koha-qa errors -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10683 Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off CC| |bgkriegel@gmail.com -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10683 Jonathan Druart <jonathan.druart@biblibre.com> 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=10683 Jonathan Druart <jonathan.druart@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #20747|0 |1 is obsolete| | --- Comment #3 from Jonathan Druart <jonathan.druart@biblibre.com> --- Created attachment 21241 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=21241&action=edit Bug 10683: CRUD routines in C4::Circulation need unit tests This patch adds some unit tests wrap in a transaction for C4::Circulation.pm. Circulation_Branch.t adds tests for routines which deal with branch_item_rules,branch_borrower_circ_rules, default_branch_circ_rules, default_circ_rules, default_branch_item_rules in the database. Circulation_issue.t adds tests for routines which deal with accountline and issues in the database. NOTE: Some commented tests have to be fixed, and some tests can be added.More, other routines of Circulation.pm are tested in the patches: 10692 UT: Routines about transfers in Circulation.pm need unit tests 10710 UT : OfflineOperation's routines in C4/Circulation.t need unit tests 10767 UT: Routines which interact with the table issuingrules in C4/Circulation need unit test Test plan: prove t/db_dependent/Circulation_issue.t t/db_dependent/Circulation_issue.t .. ok All tests successful. Files=1, Tests=16, 0 wallclock secs ( 0.02 usr 0.00 sys + 0.40 cusr 0.02 csys = 0.44 CPU) Result: PASS prove t/db_dependent/Circulation_Branch.t t/db_dependent/Circulation_Branch.t .. ok All tests successful. Files=1, Tests=10, 2 wallclock secs ( 0.06 usr 0.00 sys + 1.02 cusr 0.06 csys = 1.14 CPU) Result: PASS Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> Comment: Well, I don't know exactly what to do with this, so I left it to QA a) prove t/db_dependent/Circulation_Branch.t works well and without erros b) prove t/db_dependent/Circulation_issue.t works without errors for me ONLY if I have a issuingrule for All, All with 1 as renewals allowed, in other cases it fails. No koha-qa errors Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10683 --- Comment #4 from Jonathan Druart <jonathan.druart@biblibre.com> --- Created attachment 21243 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=21243&action=edit Bug 7791 : Give the ability to delete records when deleting a basket Currently, when a basket is deleted, all the orders are deleted (there is a foreign key in aqorders table on basketno). This could be dangerous, and there is no warn. After the deletion, unused biblios are left in the catalogue. This patch - adds a more detailed message describing the consequences of deletion - give the choice of also deleting biblio records if possible To test : Test A : 1. create a basket with 4 orders: - an order from a new record A - an order from a record B which has already an item - an order from a record C used in a subscription - an order from a record D used in an other order 2. note the biblionumbers of the records used (or open them in other tabs in yout browser) 3. click on "Delete basket" 4. choose button "Delete basket and orders" 5. check the catalogue : records A,B,C,D must still be there Test B: 1. create a basket with 4 orders: - an order from a new record A - an order from a record B which has already an item - an order from a record C used in a subscription - an order from a record D used in an other order 2. note the biblionumbers of the records used (or open them in other tabs in yout browser) 3. click on "Delete basket" 4. choose button "Delete basket, orders and records" 5. check the catalogue : records B,C,D must still be there. Record A must be deleted -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10683 Jonathan Druart <jonathan.druart@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #21243|0 |1 is obsolete| | --- Comment #5 from Jonathan Druart <jonathan.druart@biblibre.com> --- Created attachment 21244 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=21244&action=edit Bug 10683: Followup CRUD routines in C4::Circulation need unit tests The borrowers table needs to be cleared after the items table (last_returned_by column). Some checks were missing for GetRenewCount and AddRenewal. Now the tests simulated a renewal for a item and check that the renews left is decremented. Moreover the issuingrules tables should be cleared and filled with known values. Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10683 Galen Charlton <gmcharlt@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |rel_3_14_candidate -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10683 Galen Charlton <gmcharlt@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to Master CC| |gmcharlt@gmail.com --- Comment #6 from Galen Charlton <gmcharlt@gmail.com> --- Pushed to master. Thanks, Kenza! -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org