Summary: | Koha/Patrons.t: Subtests get_age and is_valid_age do not pass in another timezone | ||
---|---|---|---|
Product: | Koha | Reporter: | Marcel de Rooy <m.de.rooy> |
Component: | Test Suite | Assignee: | Marcel de Rooy <m.de.rooy> |
Status: | CLOSED FIXED | QA Contact: | Katrin Fischer <katrin.fischer> |
Severity: | minor | ||
Priority: | P5 - low | CC: | fridolin.somers, jonathan.druart |
Version: | Main | ||
Hardware: | All | ||
OS: | All | ||
See Also: | https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25621 | ||
GIT URL: | Change sponsored?: | --- | |
Patch complexity: | Trivial patch | Documentation contact: | |
Documentation submission: | Text to go in the release notes: | ||
Version(s) released in: |
23.11.00,23.05.05,22.11.11
|
Circulation function: | |
Attachments: |
Bug 34489: Testing
Bug 34489: Fix timezone problem in Patrons.t Bug 34489: Fix timezone problem in Patrons.t |
Description
Marcel de Rooy
2023-08-07 12:47:49 UTC
(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 ? Created attachment 154318 [details] [review] Bug 34489: Testing 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. 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' );
Comment on attachment 154318 [details] [review] Bug 34489: Testing Will be following same approach as on bug 34930 now. Created attachment 156285 [details] [review] 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> Trivial: Self SO Created attachment 156386 [details] [review] 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> Pushed to master for 23.11. Nice work everyone, thanks! Pushed to 23.05.x for 23.05.05 Nice work everyone! Pushed to oldstable for 22.11.x |