[Bug 34489] New: Koha/Patrons.t: Run get_age and is_valid_age in UTC
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34489 Bug ID: 34489 Summary: Koha/Patrons.t: Run get_age and is_valid_age in UTC Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: Test Suite Assignee: chris@bigballofwax.co.nz Reporter: m.de.rooy@rijksmuseum.nl QA Contact: testopia@bugs.koha-community.org Running in Amsterdam TZ gives: # Subtest: get_age not ok 5 - Today=2020-02-28, dob=2004-02-28, should be 16 # Failed test 'Today=2020-02-28, dob=2004-02-28, should be 16' # at t/db_dependent/Koha/Patrons.t line 814. # got: '15' # expected: '16' not ok 9 - Today=2020-02-28, dob=2002-02-28, should be 18 not ok 16 - Today=2020-02-29, dob=2004-02-29, should be 16 not ok 19 - Today=2020-03-01, dob=2002-03-01, should be 18 not ok 23 - Today=2020-03-01, dob=2004-03-01, should be 16 not ok 25 - Today=2019-01-31, dob=2001-01-31, should be 18 not ok 28 - Today=2019-01-31, dob=2003-01-31, should be 16 # Looks like you failed 7 tests of 31. not ok 18 - get_age # Subtest: is_valid_age not ok 2 - Today=2020-02-28, dob=2009-02-28, is 11, should be valid=0 in category AGE_5_10 # Failed test 'Today=2020-02-28, dob=2009-02-28, is 11, should be valid=0 in category AGE_5_10' # at t/db_dependent/Koha/Patrons.t line 893. # got: '1' # expected: '0' not ok 7 - Today=2020-02-28, dob=2015-02-28, is 5, should be valid=1 in category AGE_5_10 # Failed test 'Today=2020-02-28, dob=2015-02-28, is 5, should be valid=1 in category AGE_5_10' # at t/db_dependent/Koha/Patrons.t line 893. # got: '0' # expected: '1' # Looks like you failed 2 tests of 10. not ok 19 - is_valid_age Adding a tzset to UTC in the test as a workaround. Bug 25621 suggests patching DateUtils.pm as a definitive solution? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34489 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|chris@bigballofwax.co.nz |m.de.rooy@rijksmuseum.nl Severity|enhancement |minor -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34489 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Summary|Koha/Patrons.t: Run get_age |Koha/Patrons.t: Subtests |and is_valid_age in UTC |get_age and is_valid_age do | |not pass in another | |timezone -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34489 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=25621 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34489 --- Comment #1 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- (In reply to Marcel de Rooy from comment #0)
Adding a tzset to UTC in the test as a workaround. Bug 25621 suggests patching DateUtils.pm as a definitive solution?
No tzset is not satisfactory. What about removing floating from get_age ? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34489 --- Comment #2 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 154318 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=154318&action=edit Bug 34489: Testing -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34489 --- Comment #3 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- dt_from_string is rather weird with time zones. Why not pass now in server_tz ? See testing patch too. Some tests in DateUtils.t are just wrong. Try testing in Pacific/Fiji. Having a difference of 13 hours, will make one of the rfc3339 tests fail. The test is wrong. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34489 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jonathan.druart+koha@gmail. | |com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34489 --- Comment #4 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- This might be in the same category: t/db_dependent/api/v1/patrons.t not ok 6 - Filtering by date-time works # Failed test 'Filtering by date-time works' # at t/db_dependent/api/v1/patrons.t line 123. # got: undef # expected: '2253' my $last_seen_rfc3339 = $last_seen . "z"; $t->get_ok("//$userid:$password@/api/v1/patrons?last_seen=" . $last_seen_rfc3339 . "&cardnumber=" . $patron->cardnumber)
status_is(200) json_is( '/0/patron_id' => $patron->id, 'Filtering by date-time works' );
-- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34489 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #154318|0 |1 is obsolete| | --- Comment #5 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Comment on attachment 154318 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=154318 Bug 34489: Testing Will be following same approach as on bug 34930 now. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34489 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |ASSIGNED -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34489 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |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=34489 --- Comment #6 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 156285 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=156285&action=edit Bug 34489: Fix timezone problem in Patrons.t See also bug 34930. Using same approach. Test plan: export TZ='Europe/Amsterdam' prove t/db_dependent/Koha/Patrons.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=34489 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off --- Comment #7 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Trivial: Self SO -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34489 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- QA Contact|testopia@bugs.koha-communit |katrin.fischer@bsz-bw.de |y.org | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34489 Katrin Fischer <katrin.fischer@bsz-bw.de> 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=34489 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #156285|0 |1 is obsolete| | --- Comment #8 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Created attachment 156386 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=156386&action=edit Bug 34489: Fix timezone problem in Patrons.t See also bug 34930. Using same approach. Test plan: export TZ='Europe/Amsterdam' prove t/db_dependent/Koha/Patrons.t Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34489 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Version(s)| |23.11.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=34489 --- Comment #9 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Pushed to master for 23.11. Nice work everyone, thanks! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34489 Fridolin Somers <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to master |Pushed to stable Version(s)|23.11.00 |23.11.00,23.05.05 released in| | CC| |fridolin.somers@biblibre.co | |m --- Comment #10 from Fridolin Somers <fridolin.somers@biblibre.com> --- Pushed to 23.05.x for 23.05.05 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34489 Jacob O'Mara <jacob.omara@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to stable |Pushed to oldstable Version(s)|23.11.00,23.05.05 |23.11.00,23.05.05,22.11.11 released in| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34489 --- Comment #11 from Jacob O'Mara <jacob.omara@ptfs-europe.com> --- Nice work everyone! Pushed to oldstable for 22.11.x -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org