FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

test: make temp path customizable by jbergstroem · Pull Request #3325 · nodejs/node · GitHub

/ node Public

test: make temp path customizable - #3325

Merged
jbergstroem merged 2 commits into
nodejs:masterfrom
jbergstroem:feature/rework_common_pipe
Dec 30, 2015
Merged

test: make temp path customizable#3325
jbergstroem merged 2 commits into
nodejs:masterfrom
jbergstroem:feature/rework_common_pipe

Conversation

Copy link
Copy Markdown
Member

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 since NODE_COMMON_PIPE otherwise would have been used from multiple tests.

/R=@nodejs/build, @Trott ?

Copy link
Copy Markdown
Member Author

CI (without passing NODE_TMP_DIR): https://ci.nodejs.org/job/node-test-commit/804/

jbergstroem added the build Issues and PRs related to build files or the CI. label Oct 12, 2015
Comment thread test/common.js Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

__dirname perhaps?

rvagg commented Oct 12, 2015

Copy link
Copy Markdown
Member

I'm still catching up but did NODE_COMMON_PIPE get removed from all the tests already?

Copy link
Copy Markdown
Member Author

AFAIK it was never in tests, just passed to exports.PIPE [edit: if passed to common.js].

mscdex added test Issues and PRs related to the tests. and removed build Issues and PRs related to build files or the CI. labels Oct 12, 2015

Trott commented Oct 12, 2015

Copy link
Copy Markdown
Member

I'll leave it to someone more in tune with the entirety of the build process to LGTM or not, but I'm +1. The common.PIPE improvements that build on this to enable parallel testing will be in a subsequent PR?

Copy link
Copy Markdown
Member Author

Prior to removal, if NODE_COMMON_PIPE was unset exports.PIPE would be stored in the temporary directory which works fine in parallel runs since the thread id is appended to common.tmpDir. The change I'm introducing is the ability to change where tmpDir lives.

jasnell commented Oct 22, 2015

Copy link
Copy Markdown
Member

@jbergstroem ... what's the status on this? Looks like it needs to be rebased at a minimum

Copy link
Copy Markdown
Member Author

@jasnell waiting for feedback/review. I'll rebase.

jbergstroem force-pushed the feature/rework_common_pipe branch from cc1749a to 3f1add0 Compare October 22, 2015 23:28

Copy link
Copy Markdown
Member Author

@Trott to answer your question regarding "enabling" parallel builds -- that would be something we'd most likely be changing in the jenkins setup.

Copy link
Copy Markdown
Member

LGTM

Can you ensure that testRoot exists? Since this is now a variable, it can be useful to set it to a directory that does not exist yet.

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?

Copy link
Copy Markdown
Member Author

@joaocgreis does the pipe really have to depend on a thread number since it already lives in its own thread folder (tmp.$thread)?

Regarding creating the directory, that's already part of refreshTmpDir.

Copy link
Copy Markdown
Member

@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 tmp.$thread directories are created by refreshTmpDir, but testRoot is not. Currently this is not a problem since the test directory always exists, but if you set NODE_TEST_DIR to a directory that does not exit, tests fail. There could be a mkdir(testRoot) or just a descriptive exception if it does not exist, but on the other hand the error is pretty clear so feel free to ignore this suggestion.

Copy link
Copy Markdown
Member Author

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/

Copy link
Copy Markdown
Member Author

Oh, and @joaocgreis -- I now create the dir through refreshTmp.

Comment thread test/common.js Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

existsSync() is deprecated so maybe use one of the suggested alternatives?

Copy link
Copy Markdown
Member Author

ping!

Comment thread test/common.js Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

needs space between + and '.'

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

should be +=

Copy link
Copy Markdown
Member

@jbergstroem wouldn't checking the NODE_TEST_DIR directly in the test runner be better?

Copy link
Copy Markdown
Member Author

@joaocgreis checking in the runner now. Also, created an option called --test-dir supplementing NODE_TEST_DIR.

Copy link
Copy Markdown
Member Author

CI (should be unaffected): https://ci.nodejs.org/job/node-test-commit/1560/

jasnell pushed a commit that referenced this pull request Jan 15, 2016
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>
jasnell pushed a commit that referenced this pull request Jan 15, 2016
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>

jasnell commented Jan 15, 2016

Copy link
Copy Markdown
Member

Landed in v4.x-staging in d33279d and b3079ef

MylesBorins pushed a commit that referenced this pull request Jan 19, 2016
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>
MylesBorins pushed a commit that referenced this pull request Jan 19, 2016
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>
MylesBorins mentioned this pull request Jan 19, 2016
scovetta pushed a commit to scovetta/node that referenced this pull request Apr 2, 2016
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>
scovetta pushed a commit to scovetta/node that referenced this pull request Apr 2, 2016
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

test Issues and PRs related to the tests.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants


Back | FazBrowse Home | New Git URL