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.
Created attachment 162398 [details] [review] 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
The tests don't fail for me. Is there something else that needs to be done first?
Created attachment 162434 [details] [review] 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
(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).
Created attachment 162435 [details] [review] 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>
Created attachment 165461 [details] [review] 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>
More reliable tests is always a win.. thanks David! Tests continue to make sense and pass, Passing QA
Pushed for 24.05! Well done everyone, thank you!
Pushed to 23.11.x for 23.11.06
Not needed in 23.05