-
Notifications
You must be signed in to change notification settings - Fork 29.7k
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 module testing stricter #11116
Closed
Closed
Conversation
This file contains 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
In test-module-loading-error: * Do not skip the rest of the test just because we are running on a platform for which the test does not know the expected system error message. Simply skip the message validation but run the remainder of the test. * Use assert.throws() in place of try/catch * Make checks more strict. Instead of partial string matches, match the entire string. Add check for Error name to at least do some validation in situations where we do not have the system error message.
Trott
added
module
Issues and PRs related to the module subsystem.
test
Issues and PRs related to the tests.
labels
Feb 2, 2017
danbev
approved these changes
Feb 2, 2017
cjihrig
approved these changes
Feb 2, 2017
assert.throws( | ||
() => { require('../fixtures/module-loading-error.node'); }, | ||
(e) => { | ||
if (dlerror_msg && !dlerror_msg.some((msg) => e.message.includes(msg))) |
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.
Would you be open to writing this check like this:
// Skip platforms where the error is not known.
if (!dlerror_msg)
return true;
return e.name === 'Error' && dlerror_msg.some((msg) => e.message.includes(msg));
EDIT: Nevermind. We don't need to skip the e.name
check on any platforms.
jasnell
approved these changes
Feb 2, 2017
thefourtheye
approved these changes
Feb 2, 2017
lpinca
approved these changes
Feb 4, 2017
jasnell
pushed a commit
that referenced
this pull request
Feb 4, 2017
In test-module-loading-error: * Do not skip the rest of the test just because we are running on a platform for which the test does not know the expected system error message. Simply skip the message validation but run the remainder of the test. * Use assert.throws() in place of try/catch * Make checks more strict. Instead of partial string matches, match the entire string. Add check for Error name to at least do some validation in situations where we do not have the system error message. PR-URL: #11116 Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Landed in 8b04bc9 |
italoacasas
pushed a commit
to italoacasas/node
that referenced
this pull request
Feb 5, 2017
In test-module-loading-error: * Do not skip the rest of the test just because we are running on a platform for which the test does not know the expected system error message. Simply skip the message validation but run the remainder of the test. * Use assert.throws() in place of try/catch * Make checks more strict. Instead of partial string matches, match the entire string. Add check for Error name to at least do some validation in situations where we do not have the system error message. PR-URL: nodejs#11116 Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
italoacasas
pushed a commit
to italoacasas/node
that referenced
this pull request
Feb 14, 2017
In test-module-loading-error: * Do not skip the rest of the test just because we are running on a platform for which the test does not know the expected system error message. Simply skip the message validation but run the remainder of the test. * Use assert.throws() in place of try/catch * Make checks more strict. Instead of partial string matches, match the entire string. Add check for Error name to at least do some validation in situations where we do not have the system error message. PR-URL: nodejs#11116 Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
krydos
pushed a commit
to krydos/node
that referenced
this pull request
Feb 25, 2017
In test-module-loading-error: * Do not skip the rest of the test just because we are running on a platform for which the test does not know the expected system error message. Simply skip the message validation but run the remainder of the test. * Use assert.throws() in place of try/catch * Make checks more strict. Instead of partial string matches, match the entire string. Add check for Error name to at least do some validation in situations where we do not have the system error message. PR-URL: nodejs#11116 Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Need backport PRs to land in v4 or v6 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
In test-module-loading-error:
platform for which the test does not know the expected system error
message. Simply skip the message validation but run the remainder of
the test.
entire string. Add check for Error name to at least do some validation
in situations where we do not have the system error message.
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passesAffected core subsystem(s)
test module