Skip to content

Commit dd2d3d3

Browse files
gibfahnjasnell
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 <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
1 parent 822bbe0 commit dd2d3d3

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
@@ -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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ const Timer = process.binding('timer_wrap').Timer;
1212
const execSync = require('child_process').execSync;
1313

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

1717
exports.fixturesDir = path.join(__dirname, 'fixtures');
1818
exports.tmpDirName = 'tmp';

0 commit comments

Comments
 (0)