-
Notifications
You must be signed in to change notification settings - Fork 30k
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: fix path to module for repl test on Windows #3608
Conversation
This is to fix the following message on windows:
|
Can someone add a 'lts-v4.x-watch' tag please? |
@john-yan ... added... likely won't go in until after v4.2.2 tho |
PR LGTM |
@jasnell Thanks for letting me know. |
var buildPath = __dirname + '/build/' + buildType + '/binding'; | ||
var buildPath = path.join(__dirname, 'build', buildType, 'binding'); | ||
// On Windows, escape backslashes in the path before passing it to REPL. | ||
if (os.platform() == 'win32') buildPath = buildPath.replace(/\\/g, '\\\\'); |
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.
Please use common.isWindows
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.
Updated, thanks
Windows accepts slash separated paths as well, right? |
@thefourtheye The reason the original test did not pass is that it has a mixture of (not escaped) backslashes from __dirname with hard coded forward slashes. I.e. "D:\node-1\test\addons\repl-domain-abort/build/Release/binding". Should I make the change from '\' to '/' ? |
Can someone give a suggestion or merge this in please? |
var buildPath = __dirname + '/build/' + buildType + '/binding'; | ||
var buildPath = path.join(__dirname, 'build', buildType, 'binding'); | ||
// On Windows, escape backslashes in the path before passing it to REPL. | ||
if (common.isWindows) buildPath = buildPath.replace(/\\/g, '\\\\'); |
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.
Can you split this across two lines please.
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.
LGTM although I would have replaced them with forward slashes. It should work the same and is arguably easier to read / less ambiguous.
Can't really merge this just yet, as the CI is under repairs, but LGTM. |
Use path join to construct the path instead of concatenating strings. Replace backslash with double backslash so that they are escaped correctly in the string passed to REPL.
I split the if statement to two lines and replaced with forward slash. |
var buildType = process.config.target_defaults.default_configuration; | ||
var buildPath = __dirname + '/build/' + buildType + '/binding'; | ||
var buildPath = path.join(__dirname, 'build', buildType, 'binding'); | ||
// On Windows, escape backslashes in the path before passing it to REPL. |
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.
Comment is wrong now. Don't worry, I'll update it when I land 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.
Oops, thanks!
LGTM with a comment. CI: https://ci.nodejs.org/job/node-test-pull-request/694/ |
@thinkingdust Could you please take a look at the failures on the CI and see if any failure are related. |
I took a look. I'm not sure if I'm parsing the output right but I can't see anything related. Many of them look like this one on Windows with a Java exception. |
Yea, those are issues with the CI itself. Will try running it again tomorrow, if no one else does by then. |
Let's see how the CI is feeling today: https://ci.nodejs.org/job/node-test-pull-request/723/ |
@cjihrig CI was bad, but should be better now: https://ci.nodejs.org/job/node-test-pull-request/729/ |
Thanks @joaocgreis. This is failing for me locally on OS X:
|
CI is mostly green except for the known CI failures. @cjihrig it appears to be running fine for me on OS X and is green on OS X in CI (https://ci.nodejs.org/job/node-test-commit-osx/1186/). Can you run the test again and verify if you're still seeing errors? |
If the CI is happy, don't let me hold this back. LGTM |
Use path join to construct the path instead of concatenating strings. Replace backslash with double backslash so that they are escaped correctly in the string passed to REPL. PR-URL: #3608 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
Landed in c0bac95 |
Use path join to construct the path instead of concatenating strings. Replace backslash with double backslash so that they are escaped correctly in the string passed to REPL. PR-URL: #3608 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
landed in v4.x-staging as c10f17f |
Use path join to construct the path instead of concatenating strings. Replace backslash with double backslash so that they are escaped correctly in the string passed to REPL. PR-URL: #3608 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
Use path join to construct the path instead of concatenating strings. Replace backslash with double backslash so that they are escaped correctly in the string passed to REPL. PR-URL: #3608 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
Use path join to construct the path instead of concatenating strings. Replace backslash with double backslash so that they are escaped correctly in the string passed to REPL. PR-URL: #3608 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
Use path join to construct the path instead of concatenating strings. Replace backslash with double backslash so that they are escaped correctly in the string passed to REPL. PR-URL: #3608 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
Use path join to construct the path instead of concatenating strings.
Replace backslash with double backslash so that they are escaped
correctly in the string passed to REPL.