Skip to content

test: actually pass TZ from the running script - #79457

Open
aslushnikov wants to merge 1 commit into
WordPress:trunkfrom
aslushnikov:actually-pass-tz
Open

test: actually pass TZ from the running script#79457
aslushnikov wants to merge 1 commit into
WordPress:trunkfrom
aslushnikov:actually-pass-tz

Conversation

@aslushnikov

Copy link
Copy Markdown
Contributor

The jest.config.js force-defines timezone to UTC; however, the
date tests run a matrix to set timezone to different values:

TZ=$timezone LANG=$locale \

This patch makes sure that the date tests actually test in different
timezones.

The `jest.config.js` force-defines timezone to `UTC`; however, the
date tests run a matrix to set timezone to different values:

https://github.com/WordPress/gutenberg/blob/a7fcec777038a55e00599eaceb4db25310f4a9c8/bin/unit-test-date.sh#L17

This patch makes sure that the date tests actually test in different
timezones.
@github-actions

github-actions Bot commented Jun 23, 2026

Copy link
Copy Markdown

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: aslushnikov <aslushnikov@git.wordpress.org>
Co-authored-by: Mamaduka <mamaduka@git.wordpress.org>
Co-authored-by: ciampo <mciampini@git.wordpress.org>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

@aslushnikov

Copy link
Copy Markdown
Contributor Author

@Mamaduka I assume date tests want to exercise different timezones, but jest config was forcing everything in UTC.

@Mamaduka

Copy link
Copy Markdown
Member

I'm not very familiar with this area, but I agree that these two parts contradict each other.

It looks like a change was introduced via #70578. cc @ciampo, @chihsuan

@ciampo

ciampo commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

Yup, if I remember correctly, we were setting the time zone to UTC in order to allow DateCalendar (and related components) tests to run reliably on every machine, instead of using local time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants