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: move hijackstdio out of require('common') #22462

Closed
wants to merge 1 commit into from

Conversation

jasnell
Copy link
Member

@jasnell jasnell commented Aug 22, 2018

Move the hijackstdio functions out of common so that they are
imported only into the tests that actually need them

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • documentation is changed or added
  • commit message follows commit guidelines

@nodejs-github-bot nodejs-github-bot added the test Issues and PRs related to the tests. label Aug 22, 2018
@@ -57,4 +62,4 @@ tests.forEach(function(test) {

assert.strictEqual(process.stdout.writeTimes, tests.length);

common.restoreStdout();
restoreStdout();
Copy link
Member

Choose a reason for hiding this comment

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

Unrelated but why isn't restoreStderr() also used?

Copy link
Member Author

Choose a reason for hiding this comment

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

No idea.

Copy link
Contributor

Choose a reason for hiding this comment

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

I remember signing off on this (#13439)... I want to say it's related to the mustNotCall mechanism?...
But it should have been docu-commented for future reference.

Copy link
Contributor

Choose a reason for hiding this comment

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

NJP (Not James's Problem)

Copy link
Contributor

Choose a reason for hiding this comment

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

Sounds like a good first issue #22472

@jasnell jasnell force-pushed the test-move-hijackstdio branch from 7bd43af to 0c8ad74 Compare August 23, 2018 13:24
* `listener` [<Function>]: a listener with a single parameter
called `data`.

Eavesdrop to `process.stderr.write` calls. Once `process.stderr.write` is
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: maybe add parentheses to `process.stderr.write`, `process.stdout.write` and `write` function in all 4 sections.

Move the hijackstdio functions out of common so that they are
imported only into the tests that actually need them
@jasnell jasnell force-pushed the test-move-hijackstdio branch from 72a28c9 to f2af892 Compare August 24, 2018 00:01
@jasnell
Copy link
Member Author

jasnell commented Aug 24, 2018

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

Trott commented Aug 24, 2018

Shouldn't the module be camelCased as hijackStdio? (Nit, can be ignored if there's any doubt/disagreement, I'm probably wrong for some reason that I'm currently unaware of anyway.)

jasnell added a commit that referenced this pull request Aug 24, 2018
Move the hijackstdio functions out of common so that they are
imported only into the tests that actually need them

PR-URL: #22462
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
@jasnell
Copy link
Member Author

jasnell commented Aug 24, 2018

Landed in 5da834f

@jasnell jasnell closed this Aug 24, 2018
addaleax pushed a commit that referenced this pull request Aug 27, 2018
Move the hijackstdio functions out of common so that they are
imported only into the tests that actually need them

PR-URL: #22462
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
targos pushed a commit that referenced this pull request Sep 3, 2018
Move the hijackstdio functions out of common so that they are
imported only into the tests that actually need them

PR-URL: #22462
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
targos pushed a commit that referenced this pull request Sep 6, 2018
Move the hijackstdio functions out of common so that they are
imported only into the tests that actually need them

PR-URL: #22462
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
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.

8 participants