Skip to content

Commit 6b54024

Browse files
gibfahnitaloacasas
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 c6aeb44 commit 6b54024

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

test/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -366,7 +366,7 @@ Synchronous version of `spawnPwd`.
366366
### tmpDir
367367
* return [&lt;String>](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type)
368368

369-
Path to the 'tmp' directory.
369+
The realpath of the 'tmp' directory.
370370

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

test/common.js

Lines changed: 1 addition & 1 deletion
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)