-
Notifications
You must be signed in to change notification settings - Fork 30.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
test: add a test to ensure the correctness of timezone upgrades #45299
Merged
nodejs-github-bot
merged 7 commits into
nodejs:main
from
RaisinTen:test/add-a-test-to-ensure-the-correctness-of-timezone-upgrades
Nov 10, 2022
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
3f2e5e3
test: add a test to ensure the correctness of timezone upgrades
RaisinTen f004140
fixup! test: address review comments and skip if no intl
RaisinTen 8780765
fixup! test: intl -> Intl in skip message
RaisinTen 693f9bc
fixup! test: add extra guards
RaisinTen 69ec584
fixup! test: add link to canned icu directory path
RaisinTen c3ee434
fixup! test: explain difference between small-icu and deps/icu-small
RaisinTen dfa9a34
fixup! test: fix typo configured -> configure
RaisinTen File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
2022e |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
'use strict'; | ||
|
||
const common = require('../common'); | ||
|
||
if (!common.hasIntl) { | ||
common.skip('missing Intl'); | ||
} | ||
|
||
// Refs: https://github.com/nodejs/node/blob/1af63a90ca3a59ca05b3a12ad7dbea04008db7d9/configure.py#L1694-L1711 | ||
if (process.config.variables.icu_path !== 'deps/icu-small') { | ||
// If Node.js is configured to use its built-in ICU, it uses a strict subset | ||
// of ICU formed using `tools/icu/shrink-icu-src.py`, which is present in | ||
// `deps/icu-small`. It is not the same as configuring the build with | ||
// `./configure --with-intl=small-icu`. The latter only uses a subset of the | ||
// locales, i.e., it uses the English locale, `root,en`, by default and other | ||
// locales can also be specified using the `--with-icu-locales` option. | ||
common.skip('not using the icu data file present in deps/icu-small/source/data/in/icudt##l.dat.bz2'); | ||
} | ||
|
||
const fixtures = require('../common/fixtures'); | ||
|
||
// This test ensures the correctness of the automated timezone upgrade PRs. | ||
|
||
const { strictEqual } = require('assert'); | ||
const { readFileSync } = require('fs'); | ||
|
||
const expectedVersion = readFileSync(fixtures.path('tz-version.txt'), 'utf8').trim(); | ||
strictEqual(process.versions.tz, expectedVersion); | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We support lots of different ways of building Node.js and ICU, including pointing to external ICU source/data files, so this test is going to need guards to work properly if its going to be part of the regular test suite.
node/configure.py
Lines 549 to 590 in 1af63a9
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have added a guard, hope that's enough?