-
-
Notifications
You must be signed in to change notification settings - Fork 33.9k
test,module: make message check MUI dependent #13393
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
Conversation
refack
left a comment
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.
Explaining + nits
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.
/s/message/messages
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.
and a comma after Windows
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.
addressed
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.
putting it in a separate line makes for easy breakpoint setting.
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.
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.
replace dlerror_msg truthy check for a trivial fallback (Line 34) mostly for keeping line short.
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.
simplify
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 fear this might actually be 'en\r\n'. Maybe .startsWith('en'), or even .includes('en'), or trim the output?
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.
Ack.
tniessen
left a comment
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.
Just discovered that this method is not 100% accurate (I changed the locale, logged off and back in without rebooting), but I think it is close enough.
> require('./test/fixtures/module-loading-error.node')
Error: %1 is not a valid Win32 application.
\\?\E:\node\test\fixtures\module-loading-error.node
at Error (native)
at Object.Module._extensions..node (module.js:597:18)
at Module.load (module.js:487:32)
at tryModuleLoad (module.js:446:12)
at Function.Module._load (module.js:438:3)
at Module.require (module.js:497:17)
at require (internal/module.js:20:19)
at repl:1:1
at sigintHandlersWrap (vm.js:22:35)
at sigintHandlersWrap (vm.js:96:12)
>
(To exit, press ^C again or type .exit)
>
E:\node>powershell -NoProfile -ExecutionPolicy Unrestricted -c "(Get-UICulture).TwoLetterISOLanguageName"
de
Will approve if CI passes.
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.
Maybe use camelCase (dlErrorMsg) for consistency while you are at it?
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.
s/if/If and add a period at the end
tniessen
left a comment
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.
Thank you for implementing this!
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.
errorMsgsByPlafrom -> errorMsgsByPlatform (and below)
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.
in for penny in for a pound: errorMessagesByPlatform
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.
adb46b5 to
6ee5498
Compare
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.
If this line fails and we hit the catch, won't localeOk still be true rather than false?
i.e. should you do this?
if (common.isWindows) {
+ localeOk = false;
const powerShellFindMUI =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.
Intentionally I chose to be strict. the less use of the "escape hatch" the better the coverage 🤔
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.
If the powershell script fails will it log an error to the console? If so then I guess that's fine.
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.
Yea because execSync pipes stderr from the child we get the error (this one is a synthetic syntax error):
C:\bin\dev\node\node.exe D:\code\node\test\parallel\test-module-loading-error.js
Get-UICulture2 : The term 'Get-UICulture2' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:2
+ (Get-UICulture2).TwoLetterISOLanguageName
+ ~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (Get-UICulture2:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
Process finished with exit code 0Notice that the exit code is 0
PR-URL: nodejs#13393 Fixes: nodejs#13376 Reviewed-By: Tobias Nießen <tniessen@tnie.de>
6ee5498 to
30a20bd
Compare
|
Landed in 30a20bd |
|
Should this be backported to v6.x? |
|
Yes. Does not land cleanly, I will backport. |

Fixes: #13376
Checklist
make -j4 test(UNIX), orvcbuild test(Windows) passesAffected core subsystem(s)
test,module