Bug 40138 - Running t/db_dependent/api/v1/patrons.t in another timezone fails
Summary: Running t/db_dependent/api/v1/patrons.t in another timezone fails
Status: NEW
Alias: None
Product: Koha
Classification: Unclassified
Component: Test Suite (show other bugs)
Version: Main
Hardware: All All
: P5 - low minor
Assignee: Chris Cormack
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-06-13 09:11 UTC by Marcel de Rooy
Modified: 2025-06-16 08:42 UTC (History)
1 user (show)

See Also:
GIT URL:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Marcel de Rooy 2025-06-13 09:11:41 UTC
TZ was Europe/Amsterdam

t/db_dependent/api/v1/patrons.t
            #   Failed test 'Filtering by date-time works'
            #   at t/db_dependent/api/v1/patrons.t line 247.
            #          got: undef
            #     expected: '5752'

            #   Failed test 'Filtering by date-time works'
            #   at t/db_dependent/api/v1/patrons.t line 270.
            #          got: undef
            #     expected: '5752'
            # Looks like you failed 2 tests of 12.

There are also date filters, but they work.
The date time filtering here does not work (two hours difference now)?

Couldnt find what happens here rightaway.
Comment 1 Marcel de Rooy 2025-06-16 08:42:45 UTC
A few cases with datetime values do implicitly assume UTC. So we could add that to the test. Not sure if we should.
Also note for instance:
    my $last_seen_rfc3339 = $last_seen . "z";
Hardcoded timezone ;)

If you have no timezone in koha-conf and you export TZ=Etc/UTC before running the test, they will pass.

Otherwise you need this at the start:
local $ENV;
$ENV{TZ} = 'Etc/UTC';
t::lib::Mocks::mock_config( 'timezone', 'Etc/UTC' );