[Bug 30125] New: Add full-stack tests for API pagination
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30125 Bug ID: 30125 Summary: Add full-stack tests for API pagination Change sponsored?: --- Product: Koha Version: unspecified Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: Test Suite Assignee: chris@bigballofwax.co.nz Reporter: tomascohen@gmail.com QA Contact: testopia@bugs.koha-community.org Currently we have some tests on the helper, and also a few (incomplete) tests in api/v1/checkouts.t I propose we add a new file with full tests coverage for pagination, using the always-picked-as-sample GET /cities route. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30125 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|chris@bigballofwax.co.nz |tomascohen@gmail.com CC| |jonathan.druart+koha@gmail. | |com, | |martin.renvoize@ptfs-europe | |.com, | |nick@bywatersolutions.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30125 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff Patch complexity|--- |Trivial patch -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30125 --- Comment #1 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 130766 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=130766&action=edit Bug 30125: Add full-stack tests for API pagination This patch adds tests for all the pagination use cases on a real route (GET /cities). It tests _page, _per_page along with the returned Link headers and total counts (i.e. X-Total-Count, X-Base-Total-Count), and the results themselves. To test: 1. Apply this patch 2. Run: $ kshell k$ prove t/db_dependent/api/v1/pagination.t => SUCCESS: Tests pass! 3. Sign off :-D Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30125 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #130766|0 |1 is obsolete| | --- Comment #2 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 130826 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=130826&action=edit Bug 30125: Add full-stack tests for API pagination This patch adds tests for all the pagination use cases on a real route (GET /cities). It tests _page, _per_page along with the returned Link headers and total counts (i.e. X-Total-Count, X-Base-Total-Count), and the results themselves. To test: 1. Apply this patch 2. Run: $ kshell k$ prove t/db_dependent/api/v1/pagination.t => SUCCESS: Tests pass! 3. Sign off :-D Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> 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=30125 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off --- Comment #3 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Excellent addition, clear code, tests passing. Going straight for PQA. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30125 Martin Renvoize <martin.renvoize@ptfs-europe.com> 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=30125 --- Comment #4 from Nick Clemens <nick@bywatersolutions.com> --- Created attachment 130827 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=130827&action=edit Bug 30125: (QA follow-up) Rename variable as cities It's what we are testing :-) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30125 --- Comment #5 from Tomás Cohen Arazi <tomascohen@gmail.com> --- (In reply to Nick Clemens from comment #4)
Created attachment 130827 [details] [review] Bug 30125: (QA follow-up) Rename variable as cities
It's what we are testing :-)
Can't you live with some bit of confusion dude? Haha -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30125 Fridolin Somers <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |fridolin.somers@biblibre.co | |m --- Comment #6 from Fridolin Somers <fridolin.somers@biblibre.com> ---
is( scalar @{$cities}, 10, '10 libraries retrieved' ); Also rename '10 cities retrieved' no ?
-- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30125 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #130827|0 |1 is obsolete| | --- Comment #7 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 131100 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=131100&action=edit Bug 30125: (QA follow-up) Rename variable as cities It's what we are testing :-) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30125 --- Comment #8 from Tomás Cohen Arazi <tomascohen@gmail.com> --- (In reply to Fridolin Somers from comment #6)
is( scalar @{$cities}, 10, '10 libraries retrieved' ); Also rename '10 cities retrieved' no ?
Done. I've amended Nick's patch. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30125 Fridolin Somers <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Version(s)| |22.05.00 released in| | Status|Passed QA |Pushed to master -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30125 --- Comment #9 from Fridolin Somers <fridolin.somers@biblibre.com> --- Pushed to master for 22.05, thanks to everybody involved 🦄 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30125 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to master |RESOLVED CC| |kyle@bywatersolutions.com Resolution|--- |FIXED -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org