Description
Jonathan Druart
2022-04-22 09:55:22 UTC
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] |