Skip to content
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: remove unnecessary assignments #4408

Closed
wants to merge 1 commit into from

Conversation

Trott
Copy link
Member

@Trott Trott commented Dec 24, 2015

common.js needs to be loaded in all tests so that there is checking
for variable leaks and possibly other things. However, it does not
need to be assigned to a variable if nothing in common.js is referred
to elsewhere in the test.

The main tradeoff for this bit of code churn is that it gets the code
base most of the way to being able to enable the no-unused-vars rule in
eslint.

(The non-tooling benefit is that it lessens cognitive load when reading
tests as it is an immediate indication that none of the functions or
properties in common.js will be used by the test.)

common.js needs to be loaded in all tests so that there is checking
for variable leaks and possibly other things. However, it does not
need to be assigned to a variable if nothing in common.js is referred
to elsewhere in the test.

The main tradeoff for this bit of code churn is that it gets the code
base most of the way to being able to enable the no-unused-vars rule in
eslint.

(The non-tooling benefit is that it lessens cognitive load when reading
tests as it is an immediate indication that none of the functions or
properties in common.js will be used by the test.)
@Trott Trott added the test Issues and PRs related to the tests. label Dec 24, 2015
@jasnell
Copy link
Member

jasnell commented Dec 24, 2015

LGTM if CI is green

@Trott
Copy link
Member Author

Trott commented Dec 24, 2015

@Trott
Copy link
Member Author

Trott commented Dec 27, 2015

Landed in 1e896a69fae430b3221610cc50294a6563ad198d

EDIT: Er, partially landed.

@Trott Trott closed this Dec 27, 2015
@Trott Trott reopened this Dec 27, 2015
Trott added a commit that referenced this pull request Dec 27, 2015
common.js needs to be loaded in all tests so that there is checking
for variable leaks and possibly other things. However, it does not
need to be assigned to a variable if nothing in common.js is referred
to elsewhere in the test.

PR-URL: #4408
Reviewed-By: James M Snell <jasnell@gmail.com>
@Trott
Copy link
Member Author

Trott commented Dec 27, 2015

Landed properly in 082cc8d. Sorry about the mess-up. I made the snap judgment to force push on the grounds that it was soon enough after the error and a slow holiday weekend throughout much of the world that a force push would not be catastrophic. (I thought I was given the guideline at onboarding that a force push to fix a significant error was OK within 3 minutes, but I may have imagined that as I can't find it anywhere now.) I'm literally the only person who has landed any commits for nearly three days, so that also entered into my "it's a slow time right now" calculation.

Hopefully I didn't make a wrong decision there, and if I did, then hopefully it's a bad decision with only minor ramifications. Apologies in advance for any heartburn this might cause.

@Trott Trott closed this Dec 27, 2015
@Trott
Copy link
Member Author

Trott commented Dec 27, 2015

(Now that I've had a moment to reflect, I wouldn't choose to handle it that way again. Eh, so I would have had two commits for this instead of one. So what? 20/20 hindsight and all that...)

Running a CI just to make sure everything is cromulent, and everything looks good so far...

@Trott
Copy link
Member Author

Trott commented Dec 27, 2015

Unrelated PPC build failure. Looks good otherwise. https://ci.nodejs.org/job/node-test-commit/1540/

@jasnell
Copy link
Member

jasnell commented Dec 27, 2015

@Trott ... doing a force push in a circumstance like that is fine, and you caught it in enough time that all is good. We've all been there so no worries. And don't worry, I'll be back to pushing commits on Monday ;-)

Fishrock123 pushed a commit to Fishrock123/node that referenced this pull request Jan 6, 2016
common.js needs to be loaded in all tests so that there is checking
for variable leaks and possibly other things. However, it does not
need to be assigned to a variable if nothing in common.js is referred
to elsewhere in the test.

PR-URL: nodejs#4408
Reviewed-By: James M Snell <jasnell@gmail.com>
@MylesBorins
Copy link
Contributor

@Trott it looks like a bunch of edits here were made to files that don't exist in v4.x yet. Would you be able to adapt this PR and send one in specifically for lts against v4.x-staging?

@Trott
Copy link
Member Author

Trott commented Jan 7, 2016

@thealphanerd Done. #4563

@MylesBorins
Copy link
Contributor

😄

@jasnell
Copy link
Member

jasnell commented Jan 8, 2016

Backport landed

scovetta pushed a commit to scovetta/node that referenced this pull request Apr 2, 2016
common.js needs to be loaded in all tests so that there is checking
for variable leaks and possibly other things. However, it does not
need to be assigned to a variable if nothing in common.js is referred
to elsewhere in the test.

PR-URL: nodejs#4408
Reviewed-By: James M Snell <jasnell@gmail.com>
@Trott Trott deleted the fix-unused-common branch January 13, 2022 22:30
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.

4 participants