[Bug 36160] New: Use $builder->build_object when creating patrons in Circulation.t
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36160 Bug ID: 36160 Summary: Use $builder->build_object when creating patrons in Circulation.t Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: Test Suite Assignee: chris@bigballofwax.co.nz Reporter: glasklas@gmail.com QA Contact: testopia@bugs.koha-community.org Since Patron::update_lastseen was introduced in Bug 15504 circulation tests can protentially crash with: "Invalid value passed, borrowers.updated_on=SCALAR(0x564a85c3e9b0) expected type is datetime" depending of the value of TrackLastPatronActivityTriggers. This probably does not happen on a fresh Koha installation, but did when I ran the tests locally with "Renew an item" activated for TrackLastPatronActivityTriggers. The reason is that in the Circulation.t tests patron objects are created through Koha::Patron->new instead of using the builder object, and $self->lastseen($now)->store; is called in update_lastseen, on an object that does not have a valid updated_on, resulting in an invalid default value being assigned inKoha/Schema/Loader/mysql.pm. Possible added future test might also crash if resulting in these patron objects being updated. This patch fixes this issue, the tests still fail for other reasons: # Failed test 'transferbook tests' # at t/db_dependent/Circulation.t line 5769. Exception 'Koha::Exceptions::MissingParameter' thrown 'The to parameter is mandatory' But will create another issue for this if not due to some strange local issues. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36160 --- Comment #1 from David Gustafsson <glasklas@gmail.com> --- Created attachment 162398 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=162398&action=edit Bug 36160: Use $builder->build_object for patron objects in Circulation.t 1) Set TrackLastPatronActivityTriggers to at least "Renew an item" 2) Run tests in t/db_dependent/Circulation.t and verify that failes with "Invalid value passed, borrowers.updated_on..." 3) Apply patch 4) Run Circulatoint.t tests again and verify that no longer produces this error -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36160 David Gustafsson <glasklas@gmail.com> 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=36160 David Gustafsson <glasklas@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|chris@bigballofwax.co.nz |glasklas@gmail.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36160 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |david@davidnind.com --- Comment #2 from David Nind <david@davidnind.com> --- The tests don't fail for me. Is there something else that needs to be done first? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36160 David Gustafsson <glasklas@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #162398|0 |1 is obsolete| | --- Comment #3 from David Gustafsson <glasklas@gmail.com> --- Created attachment 162434 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=162434&action=edit Bug 36160: Use $builder->build_object for patron objects in Circulation.t 1) Set TrackLastPatronActivityTriggers to at least "Checking out an item" 2) Run tests in t/db_dependent/Circulation.t and verify that failes with "Invalid value passed, borrowers.updated_on..." 3) Apply patch 4) Run Circulatoint.t tests again and verify that no longer produces this error -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36160 --- Comment #4 from David Gustafsson <glasklas@gmail.com> --- (In reply to David Nind from comment #2)
The tests don't fail for me. Is there something else that needs to be done first?
I assumed it was "Renew an item" since "CanBookBeRenewed test" failed, but it seems it's "Checking out an item" that needs to be enabled (I had them both enabled). -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36160 Pedro Amorim <pedro.amorim@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36160 Pedro Amorim <pedro.amorim@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #162434|0 |1 is obsolete| | --- Comment #5 from Pedro Amorim <pedro.amorim@ptfs-europe.com> --- Created attachment 162435 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=162435&action=edit Bug 36160: Use $builder->build_object for patron objects in Circulation.t 1) Set TrackLastPatronActivityTriggers to at least "Checking out an item" 2) Run tests in t/db_dependent/Circulation.t and verify that failes with "Invalid value passed, borrowers.updated_on..." 3) Apply patch 4) Run Circulatoint.t tests again and verify that no longer produces this error Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36160 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Severity|enhancement |normal CC| |martin.renvoize@ptfs-europe | |.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36160 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- QA Contact|testopia@bugs.koha-communit |martin.renvoize@ptfs-europe |y.org |.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36160 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #162435|0 |1 is obsolete| | --- Comment #6 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 165461 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=165461&action=edit Bug 36160: Use $builder->build_object for patron objects in Circulation.t 1) Set TrackLastPatronActivityTriggers to at least "Checking out an item" 2) Run tests in t/db_dependent/Circulation.t and verify that failes with "Invalid value passed, borrowers.updated_on..." 3) Apply patch 4) Run Circulatoint.t tests again and verify that no longer produces this error Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36160 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA --- Comment #7 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- More reliable tests is always a win.. thanks David! Tests continue to make sense and pass, Passing QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36160 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to main Version(s)| |24.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=36160 --- Comment #8 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Pushed for 24.05! Well done everyone, thank you! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36160 Fridolin Somers <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to main |Pushed to stable Version(s)|24.05.00 |24.05.00,23.11.06 released in| | CC| |fridolin.somers@biblibre.co | |m --- Comment #9 from Fridolin Somers <fridolin.somers@biblibre.com> --- Pushed to 23.11.x for 23.11.06 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36160 Lucas Gass <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |lucas@bywatersolutions.com Status|Pushed to stable |RESOLVED Resolution|--- |FIXED --- Comment #10 from Lucas Gass <lucas@bywatersolutions.com> --- Not needed in 23.05 -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org