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: improve test coverage in child_process #26282

Closed
wants to merge 1 commit into from

Conversation

juanarbol
Copy link
Member

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

@nodejs-github-bot nodejs-github-bot added the test Issues and PRs related to the tests. label Feb 24, 2019
@juanarbol
Copy link
Member Author

I ran make -j4 test :(

@BridgeAR
Copy link
Member

@juanarbol seems like this requires a rebase. Would you be so kind and just rebase + force-push? Otherwise we can't run the CI.

@juanarbol juanarbol force-pushed the child-process-cov branch 2 times, most recently from d7b7781 to 4169280 Compare March 12, 2019 20:12
@juanarbol
Copy link
Member Author

Sorry, I didn't see the rule of uppercased comments so I had to re-force-push to make CI pass.

@BridgeAR thank you so much! I learned a lot!!

Copy link
Member

@mhdawson mhdawson left a comment

Choose a reason for hiding this comment

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

LGTM

@BridgeAR
Copy link
Member

CI https://ci.nodejs.org/job/node-test-pull-request/21478/

@juanarbol don't worry, it is nice that you fixed that as it's less work for the person to merge the PR. Otherwise we'd fix the commit message while landing.

@juanarbol
Copy link
Member Author

Happy to help!

@juanarbol
Copy link
Member Author

Ping @BridgeAR


// Should throw if stdio is not a valid option
{
const stdio = [{ foo: 'bar' }];
Copy link
Member

Choose a reason for hiding this comment

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

I think it would be better if we can collect all invalid options which both throw expectedError here(for reduce duplicated code).

Things like:

['foo', 600, [{ foo: 'bar' }]].forEach((stdio) => {
  common.expectsError(() => _validateStdio(stdio), expectedError);
})

But it shouldn't block this :)

@BridgeAR
Copy link
Member

@juanarbol sorry, this requires another rebase.

@juanarbol
Copy link
Member Author

I've make jstest and make test both passes on my computer

@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot

This comment has been minimized.

@BridgeAR BridgeAR added the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label Dec 9, 2019
@nodejs-github-bot

This comment has been minimized.

@nodejs-github-bot

This comment has been minimized.

@nodejs-github-bot

This comment has been minimized.

@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator


// Should throw if string and not ignore, pipe, or inherit
assert.throws(() => getValidStdio('foo'), expectedError);
common.expectsError(() => getValidStdio('foo'), expectedError);
Copy link
Member

@Trott Trott Dec 17, 2019

Choose a reason for hiding this comment

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

Can you please leave it as assert.throws() here and elsewhere? Better to use the public assert than our core-only common if there's no difference.

Copy link
Member

Choose a reason for hiding this comment

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

Oh, I see, this just moves the expectsError, rather than introducing it. Never mind my comment. Should eventually be removed anyway but not necessarily in this PF and it probably needs to wait for Node.js 8 to EOL.

@Trott
Copy link
Member

Trott commented Dec 17, 2019

Landed in 14af00e

@Trott Trott closed this Dec 17, 2019
Trott pushed a commit that referenced this pull request Dec 17, 2019
PR-URL: #26282
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
MylesBorins pushed a commit that referenced this pull request Dec 17, 2019
PR-URL: #26282
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
@MylesBorins MylesBorins mentioned this pull request Dec 17, 2019
targos pushed a commit that referenced this pull request Jan 14, 2020
PR-URL: #26282
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
BethGriggs pushed a commit that referenced this pull request Feb 6, 2020
PR-URL: #26282
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
@MylesBorins MylesBorins mentioned this pull request Feb 8, 2020
@juanarbol juanarbol deleted the child-process-cov branch January 19, 2021 16:23
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.

7 participants