[Bug 22333] New: Replace duplicated code in CanBookBeRenewed with GetSoonestRenewDate
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22333 Bug ID: 22333 Summary: Replace duplicated code in CanBookBeRenewed with GetSoonestRenewDate Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: normal Priority: P5 - low Component: Circulation Assignee: koha-bugs@lists.koha-community.org Reporter: dcook@prosentient.com.au QA Contact: testopia@bugs.koha-community.org CC: gmcharlt@gmail.com, kyle.m.hall@gmail.com Target Milestone: --- There is some duplicated code between CanBookBeRenewed and GetSoonestRenewDate. -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22333 David Cook <dcook@prosentient.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|koha-bugs@lists.koha-commun |dcook@prosentient.com.au |ity.org | -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22333 David Cook <dcook@prosentient.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22333 --- Comment #1 from David Cook <dcook@prosentient.com.au> --- Created attachment 85074 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=85074&action=edit Bug 22333: Replace duplicated code in CanBookBeRenewed with GetSoonestRenewDate This patch replaces some duplicated code in CanBookBeRenewed by using the GetSoonestRenewDate function. This patch also refactors some of the auto_renew logic in CanBookBeRenewed, so that it's more readable/maintainable. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22333 --- Comment #2 from David Cook <dcook@prosentient.com.au> --- I don't have a formal test plan yet, since it's a fiddly bit of code and I have other things to do, but I wanted to share the change anyway. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22333 David Cook <dcook@prosentient.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=20360 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22333 David Cook <dcook@prosentient.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=19014 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22333 Josef Moravec <josef.moravec@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |josef.moravec@gmail.com --- Comment #3 from Josef Moravec <josef.moravec@gmail.com> --- (In reply to David Cook from comment #2)
I don't have a formal test plan yet, since it's a fiddly bit of code and I have other things to do, but I wanted to share the change anyway.
I think run test t/db_dependent/Circulation.t could be fine test plan here ;) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22333 --- Comment #4 from David Cook <dcook@prosentient.com.au> --- (In reply to Josef Moravec from comment #3)
(In reply to David Cook from comment #2)
I don't have a formal test plan yet, since it's a fiddly bit of code and I have other things to do, but I wanted to share the change anyway.
I think run test t/db_dependent/Circulation.t could be fine test plan here ;)
I'm happy to go with that if you are! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22333 Hayley Mapley <hayleymapley@catalyst.net.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Failed QA CC| |hayleymapley@catalyst.net.n | |z --- Comment #5 from Hayley Mapley <hayleymapley@catalyst.net.nz> --- Test fails with the following error: t/db_dependent/Circulation.t .. 122/126 # No tests run! t/db_dependent/Circulation.t .. 123/126 # Failed test 'No tests run for subtest "AddRenewal and AddIssuingCharge tests"' # at t/db_dependent/Circulation.t line 2948. Can't call method "lengthunit" on an undefined value at /home/vagrant/kohaclone/Koha/Charges/Fees.pm line 101. # Looks like your test exited with 11 just after 123. t/db_dependent/Circulation.t .. Dubious, test returned 11 (wstat 2816, 0xb00) Failed 4/126 subtests Test Summary Report ------------------- t/db_dependent/Circulation.t (Wstat: 2816 Tests: 123 Failed: 1) Failed test: 123 Non-zero exit status: 11 Parse errors: Bad plan. You planned 126 tests but ran 123. Files=1, Tests=123, 38 wallclock secs ( 0.07 usr 0.01 sys + 18.59 cusr 3.22 csys = 21.89 CPU) Result: FAIL -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22333 --- Comment #6 from David Cook <dcook@prosentient.com.au> --- (In reply to Hayley Mapley from comment #5)
Test fails with the following error:
t/db_dependent/Circulation.t .. 122/126 # No tests run! t/db_dependent/Circulation.t .. 123/126 # Failed test 'No tests run for subtest "AddRenewal and AddIssuingCharge tests"' # at t/db_dependent/Circulation.t line 2948. Can't call method "lengthunit" on an undefined value at /home/vagrant/kohaclone/Koha/Charges/Fees.pm line 101. # Looks like your test exited with 11 just after 123. t/db_dependent/Circulation.t .. Dubious, test returned 11 (wstat 2816, 0xb00) Failed 4/126 subtests
Test Summary Report ------------------- t/db_dependent/Circulation.t (Wstat: 2816 Tests: 123 Failed: 1) Failed test: 123 Non-zero exit status: 11 Parse errors: Bad plan. You planned 126 tests but ran 123. Files=1, Tests=123, 38 wallclock secs ( 0.07 usr 0.01 sys + 18.59 cusr 3.22 csys = 21.89 CPU) Result: FAIL
Thanks, Hayley! I'm guessing this highlights a problem with that test rather than this patch though. Hmm. What are your thoughts, Tomas? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22333 David Cook <dcook@prosentient.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Failed QA |Needs Signoff --- Comment #7 from David Cook <dcook@prosentient.com.au> --- I'm going to reset this one to needs signoff, as I think the problem is with the tests rather than the patch. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22333 Liz Rea <wizzyrea@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |wizzyrea@gmail.com Status|Needs Signoff |Failed QA --- Comment #8 from Liz Rea <wizzyrea@gmail.com> --- Hi David, I got test failures too, as follows, have a look? Liz # Failed test 'Bug 14101: Cannot renew, renewal is automatic (returned code is auto_renew)' # at t/db_dependent/Circulation.t line 601. # got: 'auto_too_soon' # expected: 'auto_renew' # Failed test 'Cannot renew, renew is automatic' # at t/db_dependent/Circulation.t line 643. # got: 'auto_too_soon' # expected: 'auto_renew' # Failed test 'Cannot renew, renew is automatic' # at t/db_dependent/Circulation.t line 661. # got: 'auto_too_soon' # expected: 'auto_renew' # Looks like you failed 2 tests of 14. # Failed test 'too_late_renewal / no_auto_renewal_after' # at t/db_dependent/Circulation.t line 662. # Failed test 'Can auto renew, OPACFineNoRenewals=10, patron has 5' # at t/db_dependent/Circulation.t line 695. # got: 'auto_too_soon' # expected: 'auto_renew' # Failed test 'Can auto renew, OPACFineNoRenewals=10, patron has 10' # at t/db_dependent/Circulation.t line 708. # got: 'auto_too_soon' # expected: 'auto_renew' # Looks like you failed 2 tests of 6. t/db_dependent/Circulation.t .. 60/125 # Failed test 'auto_too_much_oweing | OPACFineNoRenewalsBlockAutoRenew' # at t/db_dependent/Circulation.t line 724. # Failed test 'Can auto renew, patron is expired but BlockExpiredPatronOpacActions=0' # at t/db_dependent/Circulation.t line 750. # got: 'auto_too_soon' # expected: 'auto_renew' # Failed test 'Can auto renew, BlockExpiredPatronOpacActions=1 but patron is not expired' # at t/db_dependent/Circulation.t line 774. # got: 'auto_too_soon' # expected: 'auto_renew' # Looks like you failed 2 tests of 6. # Failed test 'auto_account_expired | BlockExpiredPatronOpacActions' # at t/db_dependent/Circulation.t line 776. t/db_dependent/Circulation.t .. 125/125 # Looks like you failed 4 tests of 125. t/db_dependent/Circulation.t .. Dubious, test returned 4 (wstat 1024, 0x400) Failed 4/125 subtests Test Summary Report ------------------- t/db_dependent/Circulation.t (Wstat: 1024 Tests: 125 Failed: 4) Failed tests: 58-61 Non-zero exit status: 4 Files=1, Tests=125, 36 wallclock secs ( 0.11 usr 0.01 sys + 25.60 cusr 4.60 csys = 30.32 CPU) Result: FAIL -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22333 --- Comment #9 from David Cook <dcook@prosentient.com.au> --- (In reply to Liz Rea from comment #8)
Hi David,
I got test failures too, as follows, have a look?
Liz
Ahhh thanks for that output. I'll take a look when I have a moment. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22333 Janet McGowan <janet.mcgowan@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |janet.mcgowan@ptfs-europe.c | |om -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22333 --- Comment #10 from David Cook <dcook@prosentient.com.au> --- I have too many other priorities, so I'm probably not going to be looking at this any time soon. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22333 David Cook <dcook@prosentient.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|dcook@prosentient.com.au |koha-bugs@lists.koha-commun | |ity.org -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22333 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Resolution|--- |DUPLICATE CC| |nick@bywatersolutions.com Status|Failed QA |RESOLVED --- Comment #11 from Nick Clemens <nick@bywatersolutions.com> --- I think this has been addressed elsewhere and can be closed *** This bug has been marked as a duplicate of bug 29474 *** -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org