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 asserion messages in test-crypto-hash.js #18984

Conversation

pgrzesik
Copy link
Contributor

This commit improves asserion messages in parallel/test-crypto-hash.js.
Instead of just simple string literal, messages are changed to also
include values used in assertion, which should improve debugging
in case of errors.

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

None

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

@jasnell jasnell left a comment

Choose a reason for hiding this comment

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

This is an improvement but it would also be good to remove the message argument entirely.

@pgrzesik
Copy link
Contributor Author

Hey @jasnell, thanks for response, I don't have strong opinion on which approach is better - do you think that removing message args is a better way to improve those assertions ?

btw - I'd be more than happy to help on similar(or a bit more advanced) issues

@Trott
Copy link
Member

Trott commented Mar 1, 2018

assert.notStrictEqual(
a7,
undefined,
`Stream for no data generated: ${a7}, expected to generate value`
Copy link
Member

@BridgeAR BridgeAR Mar 1, 2018

Choose a reason for hiding this comment

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

a7 is always undefined in this case. So it is the same as having a static message. The same applies for the test below. I think it is best to just remove the message all along. Probably in all cases here.

This commit improves asserion messages in parallel/test-crypto-hash.js.
Instead of just simple string literal, messages are changed to also
include values used in assertion, which should improve debugging
in case of errors.
@pgrzesik pgrzesik force-pushed the fix/improve-assertions-in-test-crypto-hash branch from f9a906e to 5af816a Compare March 3, 2018 20:43
@pgrzesik pgrzesik changed the title test: Add more verbose asserion messages in test-crypto-hash.js test: Remove unnecessary asserion messages in test-crypto-hash.js Mar 3, 2018
@pgrzesik
Copy link
Contributor Author

pgrzesik commented Mar 3, 2018

Following multiple suggestions, I decided to remove messages instead of rewriting them. Thanks @BridgeAR and @jasnell

@Trott
Copy link
Member

Trott commented Mar 3, 2018

@BridgeAR BridgeAR added the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label Mar 6, 2018
BridgeAR pushed a commit that referenced this pull request Mar 11, 2018
This commit improves asserion messages in parallel/test-crypto-hash.js.
Instead of just simple string literal, messages are changed to also
include values used in assertion, which should improve debugging
in case of errors.

PR-URL: #18984
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Rich Trott <[email protected]>
Reviewed-By: Ruben Bridgewater <[email protected]>
Reviewed-By: Tobias Nießen <[email protected]>
@BridgeAR
Copy link
Member

Landed in 0e35683 🎉

@BridgeAR BridgeAR closed this Mar 11, 2018
@BridgeAR
Copy link
Member

@pgrzesik congratulations to your first commit to Node.js 🎉

targos pushed a commit that referenced this pull request Mar 17, 2018
This commit improves asserion messages in parallel/test-crypto-hash.js.
Instead of just simple string literal, messages are changed to also
include values used in assertion, which should improve debugging
in case of errors.

PR-URL: #18984
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Rich Trott <[email protected]>
Reviewed-By: Ruben Bridgewater <[email protected]>
Reviewed-By: Tobias Nießen <[email protected]>
@targos targos mentioned this pull request Mar 18, 2018
MylesBorins pushed a commit that referenced this pull request Mar 20, 2018
This commit improves asserion messages in parallel/test-crypto-hash.js.
Instead of just simple string literal, messages are changed to also
include values used in assertion, which should improve debugging
in case of errors.

PR-URL: #18984
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Rich Trott <[email protected]>
Reviewed-By: Ruben Bridgewater <[email protected]>
Reviewed-By: Tobias Nießen <[email protected]>
MayaLekova pushed a commit to MayaLekova/node that referenced this pull request May 8, 2018
This commit improves asserion messages in parallel/test-crypto-hash.js.
Instead of just simple string literal, messages are changed to also
include values used in assertion, which should improve debugging
in case of errors.

PR-URL: nodejs#18984
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Rich Trott <[email protected]>
Reviewed-By: Ruben Bridgewater <[email protected]>
Reviewed-By: Tobias Nießen <[email protected]>
jasnell pushed a commit to jasnell/node that referenced this pull request Aug 17, 2018
This commit improves asserion messages in parallel/test-crypto-hash.js.
Instead of just simple string literal, messages are changed to also
include values used in assertion, which should improve debugging
in case of errors.

PR-URL: nodejs#18984
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Rich Trott <[email protected]>
Reviewed-By: Ruben Bridgewater <[email protected]>
Reviewed-By: Tobias Nießen <[email protected]>
MylesBorins pushed a commit that referenced this pull request Sep 6, 2018
This commit improves asserion messages in parallel/test-crypto-hash.js.
Instead of just simple string literal, messages are changed to also
include values used in assertion, which should improve debugging
in case of errors.

Backport-PR-URL: #22380
PR-URL: #18984
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Rich Trott <[email protected]>
Reviewed-By: Ruben Bridgewater <[email protected]>
Reviewed-By: Tobias Nießen <[email protected]>
@MylesBorins MylesBorins mentioned this pull request Sep 6, 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.

6 participants