Skip to content

tests(utc): add unit tests for UTCDateTime and Postgres configured time zone#197

Merged
zzacharo merged 2 commits intoinveniosoftware:masterfrom
palkerecsenyi:utc
Feb 25, 2026
Merged

tests(utc): add unit tests for UTCDateTime and Postgres configured time zone#197
zzacharo merged 2 commits intoinveniosoftware:masterfrom
palkerecsenyi:utc

Conversation

@palkerecsenyi
Copy link
Member

@palkerecsenyi palkerecsenyi commented Feb 24, 2026

Added unit tests to demonstrate how UTCDateTime behaves with all 4 scenarios:

  • Pre-migration (timestamp without time zone columns) + DB is in UTC
    • Works as expected, no errors or value inconsistencies
  • Pre-migration + DB is not in UTC
    • No error but times are incorrectly shifted
    • This is the worst-case scenario. The unit test demonstrates the problem. This is fixed in fix(config): use UTC for PostgreSQL #196 as long as instances don't override the config.
  • Post-migration (timestamp with time zone columns) + DB is in UTC
    • Works as expected
  • Post-migration + DB is not in UTC
    • Raises an error when reading values from the DB

@palkerecsenyi palkerecsenyi force-pushed the utc branch 2 times, most recently from c14f14c to 7dc5857 Compare February 24, 2026 09:44
@palkerecsenyi palkerecsenyi moved this to In review 🔍 in Sprint Q1/2026 Feb 24, 2026
@zzacharo zzacharo merged commit 23d27ae into inveniosoftware:master Feb 25, 2026
3 checks passed
@github-project-automation github-project-automation bot moved this from In review 🔍 to To release 🤖 in Sprint Q1/2026 Feb 25, 2026
@palkerecsenyi palkerecsenyi deleted the utc branch March 3, 2026 12:46
@kpsherva kpsherva moved this from To release 🤖 to Released ✔️ in Sprint Q1/2026 Mar 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

2 participants