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: skip test-process-config if no config.gypi #16436

Merged
merged 0 commits into from
Oct 27, 2017

Conversation

gibfahn
Copy link
Member

@gibfahn gibfahn commented Oct 24, 2017

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.

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

test

@gibfahn gibfahn added the test Issues and PRs related to the tests. label Oct 24, 2017
@gibfahn
Copy link
Member Author

gibfahn commented Oct 24, 2017

FWIW the motivation for this is running the tests in a docker container.

// 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);
Copy link
Member

Choose a reason for hiding this comment

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

Are these necessary?

Copy link
Contributor

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

Copy link
Member Author

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.

Copy link
Member

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.

Copy link
Member Author

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.

// 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);
Copy link
Contributor

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

Copy link
Contributor

@refack refack left a comment

Choose a reason for hiding this comment

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

🏆

@mscdex mscdex added the process Issues and PRs related to the process subsystem. label Oct 24, 2017
@gibfahn
Copy link
Member Author

gibfahn commented Oct 25, 2017

@gibfahn gibfahn closed this Oct 27, 2017
@gibfahn gibfahn merged commit 502563b into nodejs:master Oct 27, 2017
@gibfahn gibfahn deleted the process-config branch October 27, 2017 15:18
@refack
Copy link
Contributor

refack commented Oct 27, 2017

Follow up (just found this up):

with open('config.gypi', 'r') as f:

gibfahn added a commit that referenced this pull request Oct 30, 2017
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>
gibfahn added a commit that referenced this pull request Oct 30, 2017
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>
gibfahn added a commit that referenced this pull request Oct 31, 2017
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>
@gibfahn gibfahn mentioned this pull request Oct 31, 2017
Qard pushed a commit to ayojs/ayo that referenced this pull request Nov 2, 2017
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>
Qard pushed a commit to ayojs/ayo that referenced this pull request Nov 2, 2017
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>
MylesBorins pushed a commit that referenced this pull request Nov 16, 2017
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>
gibfahn added a commit to gibfahn/node that referenced this pull request Nov 20, 2017
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>
@MylesBorins MylesBorins mentioned this pull request Nov 21, 2017
MylesBorins pushed a commit that referenced this pull request Nov 21, 2017
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>
MylesBorins pushed a commit that referenced this pull request Nov 28, 2017
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>
addaleax pushed a commit to ayojs/ayo that referenced this pull request Dec 7, 2017
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>
MylesBorins pushed a commit that referenced this pull request Dec 12, 2017
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>
gibfahn added a commit that referenced this pull request Dec 19, 2017
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>
gibfahn added a commit that referenced this pull request Dec 20, 2017
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
process Issues and PRs related to the process subsystem. test Issues and PRs related to the tests.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants