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: add blocks and comments to test cases in test-fs-promises #23627

Merged
merged 1 commit into from
Oct 21, 2018

Conversation

iansu
Copy link
Contributor

@iansu iansu commented Oct 12, 2018

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 Oct 12, 2018
@iansu
Copy link
Contributor Author

iansu commented Oct 12, 2018

@bcoe Please review.

async () => {
await chown(dest, 1, -1);
},
{
Copy link
Member

Choose a reason for hiding this comment

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

The error object on line 158 and 169 is same and can be stored in a variable instead:

{
  code: 'ERR_OUT_OF_RANGE',
  name: 'RangeError [ERR_OUT_OF_RANGE]',
  message: 'The value of "gid" is out of range. ' +
    'It must be >= 0 && < 4294967296. Received -1'
}

Copy link
Contributor

@bcoe bcoe left a comment

Choose a reason for hiding this comment

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

this is looking pretty good to me, a couple notes:

  • I think the one thing being tested is truncate not readFile at a glance.
  • if possible, let's see about creating a new file handle for each test; to eliminate shared state between tests.

I'll give a final read-through when we're getting closer to done, to make sure nothing else jumps out at me like truncate; thanks for taking this work on, this is an awesome first pull request.

if (!common.isWindows) {
await chown(dest, process.getuid(), process.getgid());
await handle.chown(process.getuid(), process.getgid());
// async read from file
Copy link
Contributor

Choose a reason for hiding this comment

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

I would say that this is asserting that "reading from buffer is identical to bytes written" ... whereas.

code: 'ENOSYS',
type: Error
})(err);
// async read from file handle
Copy link
Contributor

Choose a reason for hiding this comment

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

this is actually asserting that truncate behaves as expected, removing the end of the file.

@bcoe
Copy link
Contributor

bcoe commented Oct 13, 2018

@ratracegrad would you be able to provide some code review for this, since you're familiar with this file?

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.

RSLGTM

@refack
Copy link
Contributor

refack commented Oct 15, 2018

@bcoe
Copy link
Contributor

bcoe commented Oct 19, 2018

@iansu if you run the following:

git reset --soft HEAD~3 && git commit

and rewrite your commit message to:

test: add blocks and comments to fs-promises tests

☝️ this should dance around the linting issues, and I can kick off tests again.

@iansu iansu force-pushed the test-fs-promises-cleanup branch from 96afb47 to bb6c83b Compare October 19, 2018 17:32
@iansu
Copy link
Contributor Author

iansu commented Oct 19, 2018

@bcoe Done.

@bcoe
Copy link
Contributor

bcoe commented Oct 19, 2018

@iansu
Copy link
Contributor Author

iansu commented Oct 19, 2018

It seems like that's stalled waiting on a CERTIFY_SAFE sign off.

@bcoe
Copy link
Contributor

bcoe commented Oct 20, 2018

@nodejs/testing these failures look unrelated to @iansu's improvements, I intend to land this later today or tomorrow.

@Trott
Copy link
Member

Trott commented Oct 21, 2018

@nodejs/testing these failures look unrelated to @iansu's improvements, I intend to land this later today or tomorrow.

Please do not land without a green or yellow CI. Doing so encourages ignoring rather than addressing CI failures. It also violates our documented process.

Use the "Resume Build" feature (in the left nav) on a node-test-pull-request run to re-run only the things that aren't green.

Resume Build: https://ci.nodejs.org/job/node-test-pull-request/18016/

@bcoe
Copy link
Contributor

bcoe commented Oct 21, 2018

@iansu
Copy link
Contributor Author

iansu commented Oct 21, 2018

Looks like it worked this time.

PR-URL: nodejs#23627
Reviewed-By: Joyee Cheung <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Sakthipriyan Vairamani <[email protected]>
Reviewed-By: Ben Coe <[email protected]>
Reviewed-By: Refael Ackermann <[email protected]>
Reviewed-By: James M Snell <[email protected]>
@refack refack force-pushed the test-fs-promises-cleanup branch from bb6c83b to 3b7f9bc Compare October 21, 2018 20:42
@refack
Copy link
Contributor

refack commented Oct 21, 2018

Landed in 3b7f9bc 🎉

@refack refack merged commit 3b7f9bc into nodejs:master Oct 21, 2018
jasnell pushed a commit that referenced this pull request Oct 22, 2018
PR-URL: #23627
Reviewed-By: Joyee Cheung <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Sakthipriyan Vairamani <[email protected]>
Reviewed-By: Ben Coe <[email protected]>
Reviewed-By: Refael Ackermann <[email protected]>
Reviewed-By: James M Snell <[email protected]>
MylesBorins pushed a commit that referenced this pull request Nov 26, 2018
PR-URL: #23627
Reviewed-By: Joyee Cheung <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Sakthipriyan Vairamani <[email protected]>
Reviewed-By: Ben Coe <[email protected]>
Reviewed-By: Refael Ackermann <[email protected]>
Reviewed-By: James M Snell <[email protected]>
@codebytere codebytere mentioned this pull request Nov 27, 2018
rvagg pushed a commit that referenced this pull request Nov 28, 2018
PR-URL: #23627
Reviewed-By: Joyee Cheung <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Sakthipriyan Vairamani <[email protected]>
Reviewed-By: Ben Coe <[email protected]>
Reviewed-By: Refael Ackermann <[email protected]>
Reviewed-By: James M Snell <[email protected]>
MylesBorins pushed a commit that referenced this pull request Nov 29, 2018
PR-URL: #23627
Reviewed-By: Joyee Cheung <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Sakthipriyan Vairamani <[email protected]>
Reviewed-By: Ben Coe <[email protected]>
Reviewed-By: Refael Ackermann <[email protected]>
Reviewed-By: James M Snell <[email protected]>
@codebytere codebytere mentioned this pull request Nov 29, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
test Issues and PRs related to the tests.
Projects
None yet
Development

Successfully merging this pull request may close these issues.