-
Notifications
You must be signed in to change notification settings - Fork 29.7k
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
Changes in V8/ICU behaviour should be detected&tested&documented|overridden #42440
Comments
As a rule of thumb, you should not expect assigning environment variables inside a script to do anything. Or if it does, to behave consistently across node versions. Set it outside: You mention As to the rest of your bug report, I'm not sure what exactly you expect us to do. If you're arguing for more test coverage, by all means go and open a pull request. |
I totally agree that reassigning env variables in runtime is usually a bad idea; but I don't see a clear borderline between The general idea is to make relationship between Node releases and corresponding ICU versions a bit closer. I'll be glad to PR some extra tests for observable behaviours, but first there are few questions:
execFile(
process.execPath,
['-p', 'doSomething()'],
{ ...process.env, ...testingEnvVariables },
common.mustSucceed()
); ...but it might be nice to have a lower-overheaded way to masstest a huge set of env values.
|
That was tried, briefly, 8 or 9 years ago and it broke the world. It'd be infinitely worse today.
Kind of ad hoc but
|
PR-URL: nodejs/node#42683 Refs: nodejs/node#42440 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Hi, found this test while reviewing #45068 I applaud the desire to track down challenging bugs, however: A challenge here is that ICU output reflects ever-changing linguistic cultural and global preferences.
Can you give more specifics?
It may not need to be closer. Node has a minimum ICU version it can run with, but it doesn't have a maximum. ICU (and the CLDR data it pulls from) can and does update frequently, especially. Data may be subsetted due to space constraints (small icu). If you want to make a specific test, you should key the test to match exactly the following
I would treat it as a source of cultural data, and not as something to expect the same results from. That sounds strange, but consider the nature of what is being done. ICU's own tests already must change dramatically with each CLDR release. |
Hello! The ECMA-402 spec specifies the shape of the While we're nearing quite a bit of consistency on many locales, much of the data is still in flux and any attempt to "test" certain outcomes for format functions would end up in a GitHub whack-a-mole with no clear benefit. If you see the test262 specification tests for the Perhaps one thing we could do would be to run ICU tests as part of our testing suite but I doubt we float any patches over ICU for that to be necessary. |
Sorry for late reply.
For example, let's say, there is a template literal with a
I assume that we don't have to do it in Node.js as long as we don't update these separately. Whenever Overall the idea here is to test Node.js integration with its dependencies, not the dependencies themselves. For example, we don't test if it produces specific result in specific locale and specific timezone, but sometimes we have to provide specific sample to test if mutating |
no problem, thanks for replying
First of all, the regular expression should not assume an
This assumption is problematic— they are updated separately. Time zone 2022f has come out since ICU 72.1 was integrated, and more are coming. ISO 4217 has also issued an updated amendment with a new end date for the HRK (Croatian Kuna) as of just yesterday morning. And even if ICU is not system-icu, it may be a different ICU - a newer one, or updated data, such as with new time zone data.
As @ryzokuken noted, run test262. Or, actually it might be possible to run ICU's own tests, but that's by far a more complicated build process. |
This situation might easily happen due to misintegration of 3rd-party libs: one part returns
AFAICT the issue with
Not that I'm aware of.
I'm not quite sure how exactly it might cause any issues. Do you mean different Node.js releases, or that Node.js built with
Running tests that are updated together with the dependency itself doesn't help in a context of this problem: they will pass even if there are breaking changes. Running tests from previous release might produce too many unrelated failures and still not catch a breaking change with Node.js integration. |
Version
v14.17.6, v16.14.1, v18.0.0-pre
Platform
Linux nepbook 5.17.0-gentoo-nep #1 SMP Tue Mar 22 08:34:44 +08 2022 i686 Intel(R) Atom(TM) CPU N270 @ 1.60GHz GenuineIntel GNU/Linux
Subsystem
intl, deps
What steps will reproduce the bug?
Example 1
node v14.17.6:
node v16.14.1:
node v18.0.0-pre:
Example 2
node v14.17.6, v16.14.1:
node 18.0.0-pre:
How often does it reproduce? Is there a required condition?
Depends on Node version; maybe on system-icu, environment, etc.
What is the expected behavior?
Failed tests on deps bump, investigation, decision, solution.
What do you see instead?
Inconsistent behaviour in userland, weird and hard-to-debug bugs.
Additional information
I'm not 100% sure, but example 2 seems to be caused by internal caching in v8/icu. Basically it ignores setted values, such as process.env.{LANG,LC_ALL,LC_TIME}. Similar problem happened with
TZ
setter earlier; Node overrides it with #20026No clue about example 1.
Not sure if any of these must be "fixed" in Node itself (i.e. as separate issues/PRs).
Both problems could have been catched by simple tests. Improving coverage would allow to prevent such problems in the future.
Note: if CI runs in some sort of default/canonical environments, it might be a good idea to make it possible to do multiple or random combinations somehow, especially for i18n-related parts.
There is a pretty common tendency between developers to set
en_US.UTF-8
locale just to have more searchable and shareable outputs, so some bugs might slip off even from a huge multilingual community.The text was updated successfully, but these errors were encountered: