[Bug 20866] New: ArticleRequests.t fails on existing requests
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20866 Bug ID: 20866 Summary: ArticleRequests.t fails on existing requests Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: normal Priority: P5 - low Component: Test Suite Assignee: chris@bigballofwax.co.nz Reporter: m.de.rooy@rijksmuseum.nl QA Contact: testopia@bugs.koha-community.org Subtest search_limited fails. # Subtest: search_limited 1..4 ok 1 - Koha::ArticleRequests should return all article requests not ok 2 - Koha::ArticleRequests->search_limited should return all article requests for superlibrarian # Failed test 'Koha::ArticleRequests->search_limited should return all article requests for superlibrarian' # at t/db_dependent/ArticleRequests.t line 216. # got: '1' # expected: '3' ok 3 - Koha::ArticleRequests should return all article requests not ok 4 - Koha::ArticleRequests->search_limited should not return all article requests for restricted patron # Failed test 'Koha::ArticleRequests->search_limited should not return all article requests for restricted patron' # at t/db_dependent/ArticleRequests.t line 219. # got: '0' # expected: '2' # Looks like you failed 2 tests of 4. not ok 55 - search_limited Can be fixed by clearing the table at the start. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20866 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> 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=20866 --- Comment #1 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 75750 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=75750&action=edit Bug 20866: Fix ArticleRequests.t when table contains records Subtest search_limited fails. Assumptions in that code may not be true. Simple fix for now: clear the table at the start. Test plan: [1] Create an article request. [2] Run t/db_dependent/ArticleRequests.t Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20866 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|chris@bigballofwax.co.nz |m.de.rooy@rijksmuseum.nl Patch complexity|--- |Trivial patch Status|Needs Signoff |Signed Off --- Comment #2 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Signing off too: trivial fix -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20866 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jonathan.druart@bugs.koha-c | |ommunity.org Assignee|m.de.rooy@rijksmuseum.nl |jonathan.druart@bugs.koha-c | |ommunity.org Status|Signed Off |ASSIGNED --- Comment #3 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- There are some problems hidden your patch actually. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20866 --- Comment #4 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Created attachment 75784 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=75784&action=edit [ALTERNATIVE PATH] Bug 20866: Make ArticleRequests.t pass even if table is not empty Previous patch from Marcel removed the data from article_requests, I do not think it is a good idea to remove existing data, it could hide bugs. This patch moves the count inside the subtest block in order to have the correct value when these tests are executed. Previous code was broken: Koha::Patron->store does not generate a userid, and ->search_limited did not work correctly (Koha::Patron->has_permission returned early because of the non-existing userid, 'return unless $self->userid;'); Test plan: [1] Create an article request. [2] Run t/db_dependent/ArticleRequests.t -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20866 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20866 Katrin Fischer <katrin.fischer@bsz-bw.de> 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=20866 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #75750|0 |1 is obsolete| | Attachment #75784|0 |1 is obsolete| | --- Comment #5 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Created attachment 75791 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=75791&action=edit Bug 20866: Make ArticleRequests.t pass even if table is not empty Previous patch from Marcel removed the data from article_requests, I do not think it is a good idea to remove existing data, it could hide bugs. This patch moves the count inside the subtest block in order to have the correct value when these tests are executed. Previous code was broken: Koha::Patron->store does not generate a userid, and ->search_limited did not work correctly (Koha::Patron->has_permission returned early because of the non-existing userid, 'return unless $self->userid;'); Test plan: [1] Create an article request. [2] Run t/db_dependent/ArticleRequests.t Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20866 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> 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=20866 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #75791|0 |1 is obsolete| | --- Comment #6 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 75813 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=75813&action=edit Bug 20866: Make ArticleRequests.t pass even if table is not empty Previous patch from Marcel removed the data from article_requests, I do not think it is a good idea to remove existing data, it could hide bugs. This patch moves the count inside the subtest block in order to have the correct value when these tests are executed. Previous code was broken: Koha::Patron->store does not generate a userid, and ->search_limited did not work correctly (Koha::Patron->has_permission returned early because of the non-existing userid, 'return unless $self->userid;'); Test plan: [1] Create an article request. [2] Run t/db_dependent/ArticleRequests.t Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20866 --- Comment #7 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 75814 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=75814&action=edit Bug 20866: (QA follow-up) Use build_object and remove two tests The unique constraint on userid is handled in TestBuilder. So let's use it. The two tests if count==$count do not make much sense anymore when we call ->count a few lines before. The check with search_limited is enough. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20866 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- QA Contact|testopia@bugs.koha-communit |m.de.rooy@rijksmuseum.nl |y.org | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20866 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |nick@bywatersolutions.com Status|Passed QA |Pushed to Master --- Comment #8 from Nick Clemens <nick@bywatersolutions.com> --- Pushed to master for 18.11, awesome work all! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20866 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to Master |Pushed to Stable CC| |martin.renvoize@ptfs-europe | |.com --- Comment #9 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- This patch has been pushed to 18.05.x and will be in 18.05.01 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20866 Fridolin SOMERS <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |fridolin.somers@biblibre.co | |m Depends on| |18403 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18403 [Bug 18403] Hide patron information if not part of the logged in user library group -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20866 Fridolin SOMERS <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to Stable |RESOLVED Resolution|--- |FIXED --- Comment #10 from Fridolin SOMERS <fridolin.somers@biblibre.com> --- Depends on Bug 18403 not in 17.11.x -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org