GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||||||||||||||||
GeezerVison is showing github.com — test: fix fs realpath.native test by devsnek · Pull Request #20954 · nodejs/node Conversation
Member
If you're on a mac with a case sensitive filesystem this test fails. Checklist
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
lpinca
approved these changes
Member
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page.
Member
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page.
Member
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page.
Member
Author
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page.
Member
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page.
|
There was an error while loading. Please reload this page.
|
I suspect you're in for a lot of pain, a lot of mac apps don't deal with case sensitivity well. That aside, does this patch work for you? Detailsdiff --git a/test/parallel/test-fs-realpath-native.js b/test/parallel/test-fs-realpath-native.js index 93b5a278cf..4e9987fa8e 100644 --- a/test/parallel/test-fs-realpath-native.js +++ b/test/parallel/test-fs-realpath-native.js @@ -1,13 +1,18 @@ 'use strict'; const common = require('../common'); const assert = require('assert'); const fs = require('fs'); -if (!common.isOSX) common.skip('MacOS-only test.'); +const filename = __filename.toUpperCase(); +try { + fs.accessSync(filename); +} catch { + common.skip('not a case-insensitive fs'); +} -assert.strictEqual(fs.realpathSync.native('/users'), '/Users'); -fs.realpath.native('/users', common.mustCall(function(err, res) { +assert.strictEqual(fs.realpathSync.native(filename), __filename); +fs.realpath.native(filename, common.mustCall(function(err, res) { assert.ifError(err); - assert.strictEqual(res, '/Users'); + assert.strictEqual(res, __filename); assert.strictEqual(this, undefined); })); |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
47dd96b to
b1b596d
Compare
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
It would be good to keep the assert.ifError since it provides a much better error message in case of an error.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
b1b596d to
792e7cf
Compare
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Windows failures sure seem relevant: not ok 158 parallel/test-fs-realpath-native --- duration_ms: 0.133 severity: fail exitcode: 1 stack: |- assert.js:80 throw new AssertionError(obj); ^ AssertionError [ERR_ASSERTION]: Input A expected to strictly equal input B: + expected - actual - 'C:\\workspace\\node-test-binary-windows\\test\\parallel\\test-fs-realpath-native.js' + 'c:\\workspace\\node-test-binary-windows\\test\\parallel\\test-fs-realpath-native.js' at Object.<anonymous> (c:\workspace\node-test-binary-windows\test\parallel\test-fs-realpath-native.js:13:8) at Module._compile (internal/modules/cjs/loader.js:702:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:713:10) at Module.load (internal/modules/cjs/loader.js:612:32) at tryModuleLoad (internal/modules/cjs/loader.js:551:12) at Function.Module._load (internal/modules/cjs/loader.js:543:3) at Function.Module.runMain (internal/modules/cjs/loader.js:744:10) at startup (internal/bootstrap/node.js:241:19) at bootstrapNodeJSCore (internal/bootstrap/node.js:565:3) ... |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Ah, Windows... I guess that could be worked around by comparing the drive volume case-insensitively. Aside, the test won't work right as long as it still has this in it: |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Since the test was previously skipped everywhere but macOS, it would still be an improvement if it was skipped only on Windows now. So that could be a simple workaround here. On the other hand, since this really tests underlying OS functionality more than Node.js functionality, I wonder if it would be acceptable to get rid of the string comparisons entirely and just have it resolve Or (a bit more brittle but arguably more thorough), have it monkey-patch |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
i don't have a windows machine and i don't know anything about the quirks of window's filesystem so someone who can actually test that will need to get me a patch for it. on the other hand it seems like its really fiddly to try and detect the proper operation of case sensitive filesystems, is there another way we can test realpath? it must have some use besides resolving case. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
792e7cf to
d57049c
Compare
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
this still needs to be fixed on windows and i still don't have a windows machine |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
@devsnek Would it help if you had Remote Desktop access to a Windows machine? Or would you still likely need someone else to assist? |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Added |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
@Trott is there another way to test realpath besides case sensitivity stuff? will it resolve symlinks? relative paths? |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
http://man7.org/linux/man-pages/man3/realpath.3.html Resolves symlinks, I haven't tried to figure out why the test was added in the first place, but if removing it is not an option, maybe we can alter it to confirm that |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
d57049c to
fc70224
Compare
|
/ping @nodejs/fs |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
@nodejs/fs again |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
@nodejs/platform-windows maybe? |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
On Windows the |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
CI https://ci.nodejs.org/job/node-test-pull-request/15923/ OSX Rebuild: https://ci.nodejs.org/job/node-test-commit-osx/19888/ |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
all tests passing... landing tomorrow morning |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
ddfa979 to
bacfa87
Compare
PR-URL: nodejs#20954 Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]> Reviewed-By: James M Snell <[email protected]>
bacfa87 to
9cd932f
Compare
|
landed in 9cd932f |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
@bnoordhuis FWIW I used a case sensitive FS on macOS for the last two years without running into any issues. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
PR-URL: #20954 Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]> Reviewed-By: James M Snell <[email protected]>
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.