-
Notifications
You must be signed in to change notification settings - Fork 30.1k
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: check that process.execPath
is a realpath
#9229
Conversation
This test is only here to ensure consistent cross-platform behaviour.
assert.strictEqual(process.execPath, fs.realpathSync(process.execPath)); | ||
|
||
if (process.argv[2] === 'child') { | ||
console.log(process.execPath); |
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 please add a comment mentioning at the the console.log()
output here is part of the test
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.
@jasnell done!
I’ve set the test to skip on Windows since I don’t know if it even makes sense there… if somebody in @nodejs/platform-windows has an opinion, feel free to voice that :) |
if (common.isWindows) { | ||
common.skip('symlinks are weird on windows'); | ||
return; | ||
} |
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.
Why is the above check done? The test does not use symlinks. (If there is a good reason to skip the test, then the check for common.isWindows
below can be removed.)
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.
(Looks like this was meant for test-process-execpath.js
and not test-child-process-exec-error.js
?)
Is it possible you accidentally added the skip to the wrong file? Looks that way to me... |
854127f
to
de7c161
Compare
That is totally possible. Updated! 😄 |
This works on Windows if you use |
… silly me. Thanks for pointing that out!
Sounds to me like that should be considered a bug, or at least an OS-specific difference that should be documented? |
Looks like a bug to me, I'll take a look. @addaleax If you want to land, include the Windows skip and I'll remove it with the fix. Reviewing, the code looks good, but what's the motivation for this? Consistency sounds good, do we imply this somewhere in the docs or would it be just a nice to have? |
Sounds good to me
It came from discussion around an npm change of mine, npm/npm#14374. We weren’t quite sure whether applying So, yes, it’s just nice to have, not something we guarantee in our docs right now. |
Would anybody mind giving this a look? (@joaocgreis … was that an affirmative review?) |
New CI, the old one 404s: https://ci.nodejs.org/job/node-test-pull-request/4845/ |
Landed in 89469c8, thanks for reviewing! |
This test is only here to ensure consistent cross-platform behaviour. PR-URL: #9229 Reviewed-By: Evan Lucas <evanlucas@me.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
This test is only here to ensure consistent cross-platform behaviour. PR-URL: #9229 Reviewed-By: Evan Lucas <evanlucas@me.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
(@addaleax I missed that last mention, sorry 😔) Found this libuv PR: libuv/libuv#293 . Doesn't look like we have reasons here to push it farther than it went, so no real execPath on Windows for now. |
@joaocgreis Thanks for followingup! I kind of wonder if we should just apply Node’s |
This test is only here to ensure consistent cross-platform behaviour. PR-URL: nodejs#9229 Reviewed-By: Evan Lucas <evanlucas@me.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
This test is only here to ensure consistent cross-platform behaviour. PR-URL: #9229 Reviewed-By: Evan Lucas <evanlucas@me.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
This test is only here to ensure consistent cross-platform behaviour. PR-URL: #9229 Reviewed-By: Evan Lucas <evanlucas@me.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
This test is only here to ensure consistent cross-platform behaviour. PR-URL: #9229 Reviewed-By: Evan Lucas <evanlucas@me.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Checklist
make -j8 test
(UNIX), orvcbuild test nosign
(Windows) passesAffected core subsystem(s)
test
Description of change
This test is only here to ensure consistent cross-platform behaviour.