| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
There was a problem hiding this comment.
Typo: fixtureSource
Sorry, something went wrong.
There was a problem hiding this comment.
This could be dirName or tmpDirTarget.
Sorry, something went wrong.
There was a problem hiding this comment.
This could be dirName or tmpDirTarget.
Sorry, something went wrong.
There was a problem hiding this comment.
This could be dirName or tmpDirTarget.
Sorry, something went wrong.
There was a problem hiding this comment.
Wouldn't you rather execSync('cp -Rf Src Trg') / for windows execSync('xcopy /E /Y Src Trg')?
Sorry, something went wrong.
There was a problem hiding this comment.
I prefer the more verbose way here because:
execSync always feels like a code smell to me, although it's almost certainly not going to cause problems here.
I admit my reasons are not super-compelling but I'm also not sure the counter-arguments are super-compelling either. I'll certainly change it if this is a blocking objection. :-)
Sorry, something went wrong.
There was a problem hiding this comment.
I'm not too thrilled about this (I know it was like this before). I rather have an emperical test:
const symLinkTest = path.join(common.tmpDir, 'symLinkTest .js');
try {
fs.symlinkSync(__filename, symLinkTest);
} catch (e) {
assert.strictEqual(e.code, 'EPERM');
common.skip('insufficient privileges');
}
Sorry, something went wrong.
There was a problem hiding this comment.
Sure, done! (I changed the assert to an if ... throw.)
Sorry, something went wrong.
There was a problem hiding this comment.
Does this need to be tested upfront as opposed to wrapping the actual symlink calls in the test in a try-catch block?
Sorry, something went wrong.
There was a problem hiding this comment.
Hmmm...maybe even better: It looks like there's a common.canCreateSymlink() used in two files. I can use it here.
Sorry, something went wrong.
There was a problem hiding this comment.
This can now be fs.copyFileSync().
Sorry, something went wrong.
Sorry, something went wrong.
There was a problem hiding this comment.
Does this need to be tested upfront as opposed to wrapping the actual symlink calls in the test in a try-catch block?
Sorry, something went wrong.
|
@refack Is this OK by you as is, or do you object? If you want changes, can you clarify what changes you'd like to see? |
Sorry, something went wrong.
|
Sorry, something went wrong.
|
New CI (so this could land as soon as): https://ci.nodejs.org/job/node-test-pull-request/10092/ |
Sorry, something went wrong.
|
This failed CI across the board: not ok 1238 parallel/test-require-symlink
---
duration_ms: 0.532
severity: fail
stack: |-
assert.js:43
throw new errors.AssertionError({
^
AssertionError [ERR_ASSERTION]: 1 === 0
at ChildProcess.<anonymous> (/home/iojs/build/workspace/node-test-commit-linux/nodes/centos5-32/test/parallel/test-require-symlink.js:79:12)
at emitTwo (events.js:125:13)
at ChildProcess.emit (events.js:213:7)
at maybeClose (internal/child_process.js:944:16)
at Socket.stream.socket.on (internal/child_process.js:364:11)
at emitOne (events.js:115:13)
at Socket.emit (events.js:210:7)
at Pipe._handle.close [as _onclose] (net.js:551:12)
|
Sorry, something went wrong.
|
Hmmm...passing for me locally. But obviously not in CI.... will take a look... |
Sorry, something went wrong.
|
Odd. When I log in to a CI machine where it's failing and run the test from the CLI there, it works fine. |
Sorry, something went wrong.
|
su iojs? |
Sorry, something went wrong.
|
@refack Tried both sudo -u iojs a and su - iojs and in both cases, the test still ran fine. 🤔 |
Sorry, something went wrong.
|
I added some logging of the error in CI and it seems like linkscript.js can't find ../../common.js but only when it is run from CI. 'module.js:505
throw err;
^
Error: Cannot find module '../../common'
at Function.Module._resolveFilename (module.js:503:15)
at Function.Module._load (module.js:452:23)
at Module.require (module.js:544:17)
at require (internal/module.js:11:18)
at Object.<anonymous> (/data/iojs/node-tmp/tmp.2/module-require-symlink/symlinked.js:2:16)
at Module._compile (module.js:600:30)
at Object.Module._extensions..js (module.js:611:10)
at Module.load (module.js:521:32)
at tryModuleLoad (module.js:484:12)
at Function.Module._load (module.js:476:3)
|
Sorry, something went wrong.
|
Ah! Looks like symlinking with a full path messes things up because of a symlink higher up in the path. The tmp directories in test are symlinked to /data/iojs/node-tmp and this is no doubt a common pattern in CI (as evidenced by across-the-board failure). I'll fix the test to use relative paths for symlinking all within the tmp dir. |
Sorry, something went wrong.
|
OK, hopefully that fixes it... |
Sorry, something went wrong.
|
Cleaned up the test but missed cleaning up the fixture which still refers to the full path of the tmp directory... |
Sorry, something went wrong.
test-require-symlink modifies the fixture directory by adding a symlink. Copy the fixture to the test tmpdir instead of modifying the fixture directory. This also uses a more empirical test for checking for the ability to make symlinks on Windows.
Sorry, something went wrong.
|
OK, results look much better that time, but a few infra-related issues, some of which are now fixed, so one more time... |
Sorry, something went wrong.
|
@Trott the CI seems fine (the linter is failing often... I do not know why but maybe a eslint update might help - or does someone know where the errors might come from?). Is this ready to land? |
Sorry, something went wrong.
test-require-symlink modifies the fixture directory by adding a symlink. Copy the fixture to the test tmpdir instead of modifying the fixture directory. This also uses a more empirical test for checking for the ability to make symlinks on Windows. PR-URL: nodejs#15067 Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: James M Snell <jasnell@gmail.com>
test-require-symlink modifies the fixture directory by adding a symlink. Copy the fixture to the test tmpdir instead of modifying the fixture directory. This also uses a more empirical test for checking for the ability to make symlinks on Windows. PR-URL: #15067 Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: James M Snell <jasnell@gmail.com>
test-require-symlink modifies the fixture directory by adding a symlink. Copy the fixture to the test tmpdir instead of modifying the fixture directory. This also uses a more empirical test for checking for the ability to make symlinks on Windows. PR-URL: nodejs/node#15067 Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: James M Snell <jasnell@gmail.com>
test-require-symlink modifies the fixture directory by adding a symlink. Copy the fixture to the test tmpdir instead of modifying the fixture directory. This also uses a more empirical test for checking for the ability to make symlinks on Windows. PR-URL: nodejs/node#15067 Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: James M Snell <jasnell@gmail.com>
|
This does not land cleanly in LTS. Please feel free to manually backport by following the guide. Please also feel free to replace do-not-land if it is being backported |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
test-require-symlink modifies the fixture directory by adding a symlink.
Copy the fixture to the test tmpdir instead of modifying the fixture
directory.
Checklist
Affected core subsystem(s)
test module