Bug 34912 - Account(s).t tests fail in UTC+1 and higher
Summary: Account(s).t tests fail in UTC+1 and higher
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Architecture, internals, and plumbing (show other bugs)
Version: Main
Hardware: All All
: P5 - low minor
Assignee: Marcel de Rooy
QA Contact: Katrin Fischer
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-09-26 11:45 UTC by Marcel de Rooy
Modified: 2024-07-04 20:40 UTC (History)
2 users (show)

See Also:
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 34912: Add 14 hours to 1970 date in Account(s).t (4.49 KB, patch)
2023-09-26 11:51 UTC, Marcel de Rooy
Details | Diff | Splinter Review
Bug 34912: Add 14 hours to 1970 date in Account(s).t (4.50 KB, patch)
2023-09-29 11:28 UTC, Katrin Fischer
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Marcel de Rooy 2023-09-26 11:45:48 UTC
Account.t and Accounts.t use the datetime: 1970-01-01 00:00:01

This does not work in timezones UTC+1 to UTC+14 (note that they are also called GMT-1 to GMT-14 with sign reversed -- not confusing at all)

Adding 14 hours to the above time makes the test pass too in those time zones which will only promote using unit tests :)
Comment 1 Marcel de Rooy 2023-09-26 11:51:23 UTC
Created attachment 156221 [details] [review]
Bug 34912: Add 14 hours to 1970 date in Account(s).t

This makes those tests pass in whatever timezone.

Test plan:
Do not yet apply patch.
Change timezone on commandline with: export TZ='Etc/GMT-14'
NOTE: GMT-14 is what we also call UTC+14 (sign reversed).
Run prove t/db_dependent/Accounts.t t/db_dependent/Koha/Account.t
This fails now.
Apply patch.
Rerun tests and verify that they pass now.
Bonus: Try some other time zone.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Comment 2 Marcel de Rooy 2023-09-26 11:51:47 UTC
Trivial: Self SO
Comment 3 Katrin Fischer 2023-09-29 11:28:36 UTC
Created attachment 156380 [details] [review]
Bug 34912: Add 14 hours to 1970 date in Account(s).t

This makes those tests pass in whatever timezone.

Test plan:
Do not yet apply patch.
Change timezone on commandline with: export TZ='Etc/GMT-14'
NOTE: GMT-14 is what we also call UTC+14 (sign reversed).
Run prove t/db_dependent/Accounts.t t/db_dependent/Koha/Account.t
This fails now.
Apply patch.
Rerun tests and verify that they pass now.
Bonus: Try some other time zone.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Comment 4 Tomás Cohen Arazi (tcohen) 2023-10-04 13:15:08 UTC
Pushed to master for 23.11.

Nice work everyone, thanks!
Comment 5 Fridolin Somers 2023-10-05 19:55:35 UTC
Pushed to 23.05.x for 23.05.05
Comment 6 Matt Blenkinsop 2023-10-17 17:12:04 UTC
Nice work everyone!

Pushed to oldstable for 22.11.x