-
Notifications
You must be signed in to change notification settings - Fork 29.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
test: make temp path customizable #3325
test: make temp path customizable #3325
Conversation
CI (without passing |
@@ -6,6 +6,8 @@ var assert = require('assert'); | |||
var os = require('os'); | |||
var child_process = require('child_process'); | |||
|
|||
const testRoot = process.env.NODE_TEST_DIR || path.dirname(__filename); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
__dirname
perhaps?
I'm still catching up but did |
AFAIK it was never in tests, just passed to |
I'll leave it to someone more in tune with the entirety of the build process to |
Prior to removal, if |
@jbergstroem ... what's the status on this? Looks like it needs to be rebased at a minimum |
@jasnell waiting for feedback/review. I'll rebase. |
cc1749a
to
3f1add0
Compare
@Trott to answer your question regarding "enabling" parallel builds -- that would be something we'd most likely be changing in the jenkins setup. |
LGTM Can you ensure that To run parallel tests on Windows, the pipe name should also depend on the thread number. What about adding something like lines 64 and 66 after 139? |
@joaocgreis does the pipe really have to depend on a thread number since it already lives in its own thread folder ( Regarding creating the directory, that's already part of |
@jbergstroem the pipe is defined differently in windows, it is a global name, not a file in the test folder (as created in line 139). The |
3f1add0
to
0740b42
Compare
Rebased and fixed an issue with two tests that assumed a specific folder structure. CI (which again shouldn't branch into this): https://ci.nodejs.org/job/node-test-commit/1324/ |
Oh, and @joaocgreis -- I now create the dir through refreshTmp. |
@@ -64,18 +66,19 @@ function rmdirSync(p, originalEr) { | |||
} | |||
|
|||
exports.refreshTmpDir = function() { | |||
if (!fs.existsSync(testRoot)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
existsSync()
is deprecated so maybe use one of the suggested alternatives?
ping! |
@@ -155,21 +162,13 @@ Object.defineProperty(exports, 'hasFipsCrypto', { | |||
|
|||
if (exports.isWindows) { | |||
exports.PIPE = '\\\\.\\pipe\\libuv-test'; | |||
if (process.env.TEST_THREAD_ID) { | |||
exports.PIPE = +'.' + process.env.TEST_THREAD_ID; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
needs space between +
and '.'
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should be +=
@jbergstroem wouldn't checking the NODE_TEST_DIR directly in the test runner be better? |
00d9d98
to
f96e027
Compare
@joaocgreis checking in the runner now. Also, created an option called |
CI (should be unaffected): https://ci.nodejs.org/job/node-test-commit/1560/ |
In CI we previously passed `NODE_COMMON_PIPE` to the test runner to avoid long filenames. Add an option to the test runner that allows the user to change the temporary directory instead. This also allows us to run test suites in parallel since `NODE_COMMON_PIPE` otherwise would have been used from multiple tests at the same time. PR-URL: #3325 Reviewed-By: Joao Reis <reis@janeasystems.com>
A few tests assumed that temp dirs always lived in the same parent folder as fixtures. Make these use `common.tmpDir` instead. PR-URL: #3325 Reviewed-By: Joao Reis <reis@janeasystems.com>
Landed in v4.x-staging in d33279d and b3079ef |
In CI we previously passed `NODE_COMMON_PIPE` to the test runner to avoid long filenames. Add an option to the test runner that allows the user to change the temporary directory instead. This also allows us to run test suites in parallel since `NODE_COMMON_PIPE` otherwise would have been used from multiple tests at the same time. PR-URL: #3325 Reviewed-By: Joao Reis <reis@janeasystems.com>
A few tests assumed that temp dirs always lived in the same parent folder as fixtures. Make these use `common.tmpDir` instead. PR-URL: #3325 Reviewed-By: Joao Reis <reis@janeasystems.com>
In CI we previously passed `NODE_COMMON_PIPE` to the test runner to avoid long filenames. Add an option to the test runner that allows the user to change the temporary directory instead. This also allows us to run test suites in parallel since `NODE_COMMON_PIPE` otherwise would have been used from multiple tests at the same time. PR-URL: nodejs#3325 Reviewed-By: Joao Reis <reis@janeasystems.com>
A few tests assumed that temp dirs always lived in the same parent folder as fixtures. Make these use `common.tmpDir` instead. PR-URL: nodejs#3325 Reviewed-By: Joao Reis <reis@janeasystems.com>
In CI we previously passed
NODE_COMMON_PIPE
to the test runner to avoid long filenames on Windows. Avoid long paths by changing the temporary directory instead. This also allows us to run test suites in parallel sinceNODE_COMMON_PIPE
otherwise would have been used from multiple tests./R=@nodejs/build, @Trott ?