[Bug 26405] New: Circulation.t fails on 'AddRenewal left both fines'
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26405 Bug ID: 26405 Summary: Circulation.t fails on 'AddRenewal left both fines' Change sponsored?: --- Product: Koha Version: unspecified Hardware: All OS: All Status: NEW Severity: minor Priority: P5 - low Component: Test Suite Assignee: chris@bigballofwax.co.nz Reporter: emmi.takkinen@outlook.com QA Contact: testopia@bugs.koha-community.org Running prove t/db_dependent/Circulation.t, I receive following error: t/db_dependent/Circulation.t .. 1/48 # Failed test 'AddRenewal left both fines' # at t/db_dependent/Circulation.t line 591. # got: '1' # expected: '2' # Looks like you planned 83 tests but ran 28. # Looks like you failed 1 test of 28 run. t/db_dependent/Circulation.t .. 15/48 # Failed test 'CanBookBeRenewed tests' # at t/db_dependent/Circulation.t line 1255. Can't call method "status" on an undefined value at t/db_dependent/Circulation.t line 593. Adding t::lib::Mocks::mock_preference('CalculateFinesOnReturn', 1) solved problem since bug 23051 added following to Circulation.pm: if ( !$skipfinecalc && C4::Context->preference('CalculateFinesOnReturn') ) { _CalculateAndUpdateFine( { issue => $issue, item => $item_unblessed, borrower => $patron_unblessed } ); } However I'm unsure if this is appropriate solution or are those tests invalid at this point. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26405 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jonathan.druart@bugs.koha-c | |ommunity.org --- Comment #1 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Yes, we could mock the pref. Can you provide a patch please? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26405 Emmi Takkinen <emmi.takkinen@koha-suomi.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff Assignee|chris@bigballofwax.co.nz |emmi.takkinen@koha-suomi.fi --- Comment #2 from Emmi Takkinen <emmi.takkinen@koha-suomi.fi> --- Created attachment 114135 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=114135&action=edit Bug 26405: Prevent Circulation.t failing on 'AddRenewal left both fines' Bug 23051 added option to skip calculating fines even when "CalculateFinesOnReturn" is enabled. Due this Circulation.t fails on test "AddRenewal left both fines" if "CalculateFinesOnReturn" is disabled on ones system. Mocking syspref while testing fixes failig tests. To test: 1. Disable "CalculateFinesOnReturn". 2. Run prove t/db_dependent/Circulation.t => Tests fail 3. Apply patch. 4. Run prove t/db_dependent/Circulation.t again => Tests are succesful -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26405 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off CC| |tomascohen@gmail.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26405 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #114135|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26405 --- Comment #3 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 118342 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=118342&action=edit Bug 26405: Prevent Circulation.t failing on 'AddRenewal left both fines' Bug 23051 added option to skip calculating fines even when "CalculateFinesOnReturn" is enabled. Due this Circulation.t fails on test "AddRenewal left both fines" if "CalculateFinesOnReturn" is disabled on ones system. Mocking syspref while testing fixes failig tests. To test: 1. Disable "CalculateFinesOnReturn". 2. Run prove t/db_dependent/Circulation.t => Tests fail 3. Apply patch. 4. Run prove t/db_dependent/Circulation.t again => Tests are succesful Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26405 --- Comment #4 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Good catch. Those tests do not cover the case in which the syspref is set. But I believe this is tested in t/db_dependent/Circulation/Returns.t (somehow). -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26405 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |kyle@bywatersolutions.com QA Contact|testopia@bugs.koha-communit |kyle@bywatersolutions.com |y.org | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26405 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=26405 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #118342|0 |1 is obsolete| | --- Comment #5 from Kyle M Hall <kyle@bywatersolutions.com> --- Created attachment 120122 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=120122&action=edit Bug 26405: Prevent Circulation.t failing on 'AddRenewal left both fines' Bug 23051 added option to skip calculating fines even when "CalculateFinesOnReturn" is enabled. Due this Circulation.t fails on test "AddRenewal left both fines" if "CalculateFinesOnReturn" is disabled on ones system. Mocking syspref while testing fixes failig tests. To test: 1. Disable "CalculateFinesOnReturn". 2. Run prove t/db_dependent/Circulation.t => Tests fail 3. Apply patch. 4. Run prove t/db_dependent/Circulation.t again => Tests are succesful Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> 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=26405 Jonathan Druart <jonathan.druart+koha@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to master Version(s)| |21.05.00 released in| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26405 --- Comment #6 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- Pushed to master for 21.05, thanks to everybody involved! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26405 Fridolin Somers <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Version(s)|21.05.00 |21.05.00,20.11.06 released in| | Status|Pushed to master |Pushed to stable CC| |fridolin.somers@biblibre.co | |m --- Comment #7 from Fridolin Somers <fridolin.somers@biblibre.com> --- Pushed to 20.11.x for 20.11.06 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26405 Andrew Fuerste-Henry <andrew@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Version(s)|21.05.00,20.11.06 |21.05.00,20.11.06,20.05.12 released in| | CC| |andrew@bywatersolutions.com Status|Pushed to stable |Pushed to oldstable --- Comment #8 from Andrew Fuerste-Henry <andrew@bywatersolutions.com> --- Pushed to 20.05.x for 20.05.12 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26405 Victor Grousset/tuxayo <victor@tuxayo.net> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to oldstable |RESOLVED CC| |victor@tuxayo.net Resolution|--- |FIXED --- Comment #9 from Victor Grousset/tuxayo <victor@tuxayo.net> --- Not backported to oldoldstable (19.11.x). Feel free to ask if it's needed. -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org