-
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: skip test-process-config if no config.gypi #16436
Conversation
FWIW the motivation for this is running the tests in a docker container. |
test/parallel/test-process-config.js
Outdated
// If the assert fails, it only shows 3 lines. We need all the output to | ||
// compare. | ||
console.log('config:', config); | ||
console.log('process.config:', process.config); |
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.
Are these necessary?
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.
I believe as the comment states, in case the assertion in L60 fails the output it will show will be truncated. This logging is so that we'll have the raw input.
This could be minimized by wrapping the assert in a try ... catch
and log in the catch before rethrowing
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.
See the comment. If the test passes nothing gets logged. If the test fails the assert just logs the first three lines, which is completely useless.
When this test fails it's usually because something is subtly different in your config, and you need to diff the two files to find out what it is.
This could be minimized by wrapping the assert in a try ... catch and log in the catch before rethrowing
Good idea.
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.
If the test fails the assert just logs the first three lines, which is completely useless.
Sounds like a problem with assert.deepStrictEqual
, but that should be addressed elsewhere.
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.
Added a commit to wrap in try/catch.
I think the better fix is to use common.log()
, but we haven't implemented that yet. I'll raise a PR for it later.
test/parallel/test-process-config.js
Outdated
// If the assert fails, it only shows 3 lines. We need all the output to | ||
// compare. | ||
console.log('config:', config); | ||
console.log('process.config:', process.config); |
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.
I believe as the comment states, in case the assertion in L60 fails the output it will show will be truncated. This logging is so that we'll have the raw input.
This could be minimized by wrapping the assert in a try ... catch
and log in the catch before rethrowing
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.
🏆
b967d53
to
45f3a06
Compare
45f3a06
to
85daa2c
Compare
85daa2c
to
502563b
Compare
Follow up (just found this up): Line 941 in 22882d4
|
If you run the tests in a different machine to the one you built on, this test will fail. Avoid this by skipping if the file doesn't exist. We shouldn't need to check that the file exists in this test, as the build won't pass without a config.gypi anyway. Also adds console.logs, so you can see what the actual difference between the objects was, as `assert.deepStrictEqual()` only shows you the first three lines. PR-URL: #16436 Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
If you run the tests in a different machine to the one you built on, this test will fail. Avoid this by skipping if the file doesn't exist. We shouldn't need to check that the file exists in this test, as the build won't pass without a config.gypi anyway. Also adds console.logs, so you can see what the actual difference between the objects was, as `assert.deepStrictEqual()` only shows you the first three lines. PR-URL: #16436 Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
If you run the tests in a different machine to the one you built on, this test will fail. Avoid this by skipping if the file doesn't exist. We shouldn't need to check that the file exists in this test, as the build won't pass without a config.gypi anyway. Also adds console.logs, so you can see what the actual difference between the objects was, as `assert.deepStrictEqual()` only shows you the first three lines. PR-URL: #16436 Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
If you run the tests in a different machine to the one you built on, this test will fail. Avoid this by skipping if the file doesn't exist. We shouldn't need to check that the file exists in this test, as the build won't pass without a config.gypi anyway. Also adds console.logs, so you can see what the actual difference between the objects was, as `assert.deepStrictEqual()` only shows you the first three lines. PR-URL: nodejs/node#16436 Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
If you run the tests in a different machine to the one you built on, this test will fail. Avoid this by skipping if the file doesn't exist. We shouldn't need to check that the file exists in this test, as the build won't pass without a config.gypi anyway. Also adds console.logs, so you can see what the actual difference between the objects was, as `assert.deepStrictEqual()` only shows you the first three lines. PR-URL: nodejs/node#16436 Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
If you run the tests in a different machine to the one you built on, this test will fail. Avoid this by skipping if the file doesn't exist. We shouldn't need to check that the file exists in this test, as the build won't pass without a config.gypi anyway. Also adds console.logs, so you can see what the actual difference between the objects was, as `assert.deepStrictEqual()` only shows you the first three lines. PR-URL: #16436 Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
If config.gypi isn't defined, assume Node was build the default way, i.e. with the inspector. PR-URL: nodejs#16621 Refs: nodejs#16436 (comment) Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
If you run the tests in a different machine to the one you built on, this test will fail. Avoid this by skipping if the file doesn't exist. We shouldn't need to check that the file exists in this test, as the build won't pass without a config.gypi anyway. Also adds console.logs, so you can see what the actual difference between the objects was, as `assert.deepStrictEqual()` only shows you the first three lines. PR-URL: #16436 Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
If you run the tests in a different machine to the one you built on, this test will fail. Avoid this by skipping if the file doesn't exist. We shouldn't need to check that the file exists in this test, as the build won't pass without a config.gypi anyway. Also adds console.logs, so you can see what the actual difference between the objects was, as `assert.deepStrictEqual()` only shows you the first three lines. PR-URL: #16436 Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
If you run the tests in a different machine to the one you built on, this test will fail. Avoid this by skipping if the file doesn't exist. We shouldn't need to check that the file exists in this test, as the build won't pass without a config.gypi anyway. Also adds console.logs, so you can see what the actual difference between the objects was, as `assert.deepStrictEqual()` only shows you the first three lines. PR-URL: nodejs/node#16436 Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
If config.gypi isn't defined, assume Node was build the default way, i.e. with the inspector. PR-URL: #16621 Refs: #16436 (comment) Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
If config.gypi isn't defined, assume Node was build the default way, i.e. with the inspector. PR-URL: #16621 Refs: #16436 (comment) Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
If config.gypi isn't defined, assume Node was build the default way, i.e. with the inspector. PR-URL: #16621 Refs: #16436 (comment) Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
If you run the tests in a different machine to the one you built on,
this test will fail. Avoid this by skipping if the file doesn't exist.
We shouldn't need to check that the file exists in this test, as the
build won't pass without a config.gypi anyway.
Also adds console.logs, so you can see what the actual difference
between the objects was, as
assert.deepStrictEqual()
only shows youthe first three lines.
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passesAffected core subsystem(s)
test