Skip to content

Commit

Permalink
test: use realpath for NODE_TEST_DIR in common.js
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
gibfahn authored and MylesBorins committed Mar 9, 2017
1 parent 626875f commit 9abde3a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion test/common.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const stream = require('stream');
const util = require('util');

const testRoot = process.env.NODE_TEST_DIR ?
path.resolve(process.env.NODE_TEST_DIR) : __dirname;
fs.realpathSync(process.env.NODE_TEST_DIR) : __dirname;

exports.testDir = __dirname;
exports.fixturesDir = path.join(exports.testDir, 'fixtures');
Expand Down

0 comments on commit 9abde3a

Please sign in to comment.