Skip to content

Commit 0f3677d

Browse files
gibfahnMylesBorins
authored andcommitted
test: use realpath for NODE_TEST_DIR in common.js
If you don't specify NODE_TEST_DIR, common.tmpDir will resolve to the realpath of `node/test`. If you do specify NODE_TEST_DIR (with the environment variable or by running or by running tools/test.py --test-dir=x), common.tmpDir (which is resolved from testRoot) uses the symbolic path (doesn't resolve symlinks). This uses fs.realpathSync() to fix that. PR-URL: #10723 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Sakthipriyan Vairamani <[email protected]> Reviewed-By: Michael Dawson <[email protected]>
1 parent 7ee04c6 commit 0f3677d

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

test/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -373,7 +373,7 @@ Synchronous version of `spawnPwd`.
373373
### tmpDir
374374
* return [&lt;String>](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type)
375375

376-
Path to the 'tmp' directory.
376+
The realpath of the 'tmp' directory.
377377

378378
### tmpDirName
379379
* return [&lt;String>](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type)

test/common.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ const util = require('util');
1010
const Timer = process.binding('timer_wrap').Timer;
1111

1212
const testRoot = process.env.NODE_TEST_DIR ?
13-
path.resolve(process.env.NODE_TEST_DIR) : __dirname;
13+
fs.realpathSync(process.env.NODE_TEST_DIR) : __dirname;
1414

1515
exports.fixturesDir = path.join(__dirname, 'fixtures');
1616
exports.tmpDirName = 'tmp';

0 commit comments

Comments
 (0)