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: cleaning up test/parallel/test-crypto-binary-default.js #19054

Closed

Conversation

wuweiweiwu
Copy link
Contributor

Moving assertion error message to comment on top of test.
Scoping tests for better readability and debugging.

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • commit message follows commit guidelines
Affected core subsystem(s)

test

@nodejs-github-bot nodejs-github-bot added the test Issues and PRs related to the tests. label Feb 28, 2018
@watilde
Copy link
Member

watilde commented Feb 28, 2018

@wuweiweiwu wuweiweiwu force-pushed the test-crypto-binary-default-fixes branch from 32d9450 to 624a417 Compare February 28, 2018 17:40
@wuweiweiwu
Copy link
Contributor Author

@watilde It seemed that my commit messages were failing the jenkins build. I have updated my commit messages!

@wuweiweiwu wuweiweiwu force-pushed the test-crypto-binary-default-fixes branch from 624a417 to 250cb97 Compare February 28, 2018 17:53
@watilde
Copy link
Member

watilde commented Feb 28, 2018

@wuweiweiwu Thanks for the update! I will trigger CI again.

@watilde
Copy link
Member

watilde commented Feb 28, 2018

@wuweiweiwu
Copy link
Contributor Author

wuweiweiwu commented Feb 28, 2018

@watilde I am not sure why node-test-commit is failing. I ran core-validate-commit and the only thing failing is commit must have at least 1 reviewer. Do I add the reviewers on the commit after they have approved? In that case I have updated my commit messages again :)

The default message will be printed if the assertion fires.

PR-URL: nodejs#19054
Reviewed-By: James M Snell <jasnell@gmail.com>
Puts related variables and tests in the same scope.

PR-URL: nodejs#19054
Reviewed-By: James M Snell <jasnell@gmail.com>
@wuweiweiwu wuweiweiwu force-pushed the test-crypto-binary-default-fixes branch from 250cb97 to b0f8682 Compare February 28, 2018 22:13
@watilde
Copy link
Member

watilde commented Mar 1, 2018

@wuweiweiwu Thanks for checking it! I just read the ci logs(16560, 2562, 16741, 16051) and the errors seem not related to this patch :) Let's leave this for one more day to get more review.

@watilde
Copy link
Member

watilde commented Mar 1, 2018

new ci for the last updates: https://ci.nodejs.org/job/node-test-pull-request/13421/

Copy link
Member

@BridgeAR BridgeAR left a comment

Choose a reason for hiding this comment

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

LGTM, just one nit about something that was there before.

'361ee3dba91ca5c11aa25eb4d679275cc5788063a5f19741120c4f2d' +
'e2adebeb10a298dd'
}
},

Copy link
Member

Choose a reason for hiding this comment

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

This line seems obsolete and should probably be removed.

Copy link
Member

Choose a reason for hiding this comment

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

Can you briefly explain why the line is obsolete?

Copy link
Member

Choose a reason for hiding this comment

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

These are entries in an array and all other entries are separated without extra line break.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@BridgeAR Fixed :)

@BridgeAR BridgeAR added the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label Mar 1, 2018
Copy link
Member

@apapirovski apapirovski left a comment

Choose a reason for hiding this comment

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

I'm really not clear why block scoping in this test is worth the massive diff, given how little else is changing... If something was, I wouldn't even be able to find it with 800 insertions + deletions... Does anyone that reviewed this actually claim to have scanned line by line? There isn't even any variable re-use, race conditions, or anything else here that block scoping helps us resolve.

I hate to be a downer but I'm really -1 on these type of changes.

@BridgeAR
Copy link
Member

BridgeAR commented Mar 2, 2018

@apapirovski I personally feel similar about this as you but it felt like it does not hurt either and that is why I signed it. It is possible to review this by using the split view. In that case it is much easier to scan line by line.

@Trott
Copy link
Member

Trott commented Mar 2, 2018

@apapirovski @BridgeAR Add ?w=1 to the diff URL in GitHub to ignore whitespace-only changes to make a diff like this much easier to read: https://github.com/nodejs/node/pull/19054/files?w=1

FWIW, I think adding block scope is higher value than a lot of the changes we otherwise seem to routinely approve, like changing functions to arrow functions.

@apapirovski
Copy link
Member

@Trott thanks! Is that somewhere in the GitHub interface or just a well-known trick?

@Trott
Copy link
Member

Trott commented Mar 2, 2018

@Trott thanks! Is that somewhere in the GitHub interface or just a well-known trick?

AFAIK it is not in the interface nor particularly well-known, but wow is it useful IMO.

removing extra line break
@apapirovski
Copy link
Member

Landed in 1ebd966

@apapirovski apapirovski closed this Mar 4, 2018
apapirovski pushed a commit that referenced this pull request Mar 4, 2018
The default message will be printed if the assertion fires. Use block
scope for related variables and tests.

PR-URL: #19054
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Daijiro Wachi <daijiro.wachi@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
@apapirovski
Copy link
Member

@wuweiweiwu Congrats on landing your first commit in Node.js core! 🎉 Hope there are many more to come :)

addaleax pushed a commit to addaleax/node that referenced this pull request Mar 5, 2018
The default message will be printed if the assertion fires. Use block
scope for related variables and tests.

PR-URL: nodejs#19054
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Daijiro Wachi <daijiro.wachi@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
@MylesBorins MylesBorins mentioned this pull request Mar 6, 2018
MayaLekova pushed a commit to MayaLekova/node that referenced this pull request May 8, 2018
The default message will be printed if the assertion fires. Use block
scope for related variables and tests.

PR-URL: nodejs#19054
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Daijiro Wachi <daijiro.wachi@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
MylesBorins pushed a commit that referenced this pull request Aug 17, 2018
The default message will be printed if the assertion fires. Use block
scope for related variables and tests.

PR-URL: #19054
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Daijiro Wachi <daijiro.wachi@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
@MylesBorins MylesBorins mentioned this pull request Aug 17, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
author ready PRs that have at least one approval, no pending requests for changes, and a CI started. test Issues and PRs related to the tests.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants