Because of date comparison 03:57:34 koha_1 | # Failed test 'exact match for JSON Pointer ""' 03:57:34 koha_1 | # at t/db_dependent/api/v1/acquisitions_baskets.t line 59. 03:57:34 koha_1 | # Structures begin differing at: 03:57:34 koha_1 | # $got->[1]{updated_on} = '2022-04-22T01:54:35+00:00' 03:57:34 koha_1 | # $expected->[1]{updated_on} = '2022-04-22T01:54:34+00:00' 03:57:34 koha_1 | # Looks like you failed 1 test of 3. 03:57:34 koha_1 | 03:57:34 koha_1 | # Failed test 'list_managers() tests' 03:57:34 koha_1 | # at t/db_dependent/api/v1/acquisitions_baskets.t line 63. 03:57:34 koha_1 | # Looks like you failed 1 test of 1.
Created attachment 133656 [details] [review] Bug 30596: Prevent api/v1/acquisitions_baskets.t to fail randomly
This is a bit ugly, and we will need to reuse it in (at least) api/v1/acquisitions_funds.t See commit 9bbbed2a4024311cbbd9b828eba0512f63069735 Bug 30055: API unit tests Tomas, did you deal with that already in other REST api tests?
(In reply to Jonathan Druart from comment #2) > This is a bit ugly, and we will need to reuse it in (at least) > api/v1/acquisitions_funds.t > > See > commit 9bbbed2a4024311cbbd9b828eba0512f63069735 > Bug 30055: API unit tests > > Tomas, did you deal with that already in other REST api tests? Maybe we need a new is_deeply, that accepts a list of things to exclude in the comparisson?
(In reply to Jonathan Druart from comment #2) > This is a bit ugly, and we will need to reuse it in (at least) > api/v1/acquisitions_funds.t > > See > commit 9bbbed2a4024311cbbd9b828eba0512f63069735 > Bug 30055: API unit tests > > Tomas, did you deal with that already in other REST api tests? Why not: + $superlibrarian->discard_changes; + $patron_with_permission->discard_changes;
(In reply to Nick Clemens from comment #4) > (In reply to Jonathan Druart from comment #2) > > This is a bit ugly, and we will need to reuse it in (at least) > > api/v1/acquisitions_funds.t > > > > See > > commit 9bbbed2a4024311cbbd9b828eba0512f63069735 > > Bug 30055: API unit tests > > > > Tomas, did you deal with that already in other REST api tests? > > Why not: > + $superlibrarian->discard_changes; > + $patron_with_permission->discard_changes; +1
Created attachment 133668 [details] [review] Bug 30596: Prevent api/v1/acquisitions_baskets.t to fail randomly
(In reply to Nick Clemens from comment #4) > (In reply to Jonathan Druart from comment #2) > > This is a bit ugly, and we will need to reuse it in (at least) > > api/v1/acquisitions_funds.t > > > > See > > commit 9bbbed2a4024311cbbd9b828eba0512f63069735 > > Bug 30055: API unit tests > > > > Tomas, did you deal with that already in other REST api tests? > > Why not: > + $superlibrarian->discard_changes; > + $patron_with_permission->discard_changes; Yes, I think I actually focused on the wrong thing. updated_on is modified because of the set_password call. Having an up-to-date object should fix the problem. Thanks, Nick!
Created attachment 133669 [details] [review] Bug 30596: Prevent api/v1/acquisitions_baskets.t and api/v1/acquisitions_funds.t to fail randomly because of updated_on
Created attachment 133693 [details] [review] Bug 30596: Prevent api/v1/acquisitions_baskets.t and api/v1/acquisitions_funds.t to fail randomly because of updated_on Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Created attachment 133845 [details] [review] Bug 30596: Prevent api/v1/acquisitions_baskets.t and api/v1/acquisitions_funds.t to fail randomly because of updated_on Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com> Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Works, qa script happy, code looks good, passing QA :)
Pushed to master for 22.05, thanks to everybody involved [U+1F984]