Uh oh!
There was an error while loading. Please reload this page.
Increase test coverage for fs/promises.js - #19811
Conversation
Trott
commented
Apr 5, 2018
Trott
commented
Apr 5, 2018
humphd
commented
Apr 5, 2018
@Trott OK, thanks, I'll compare with what's landed there and adjust this. |
Trott
commented
Apr 5, 2018
(Lone CI failure is unrelated. Can be re-run if this PR isn't going to change, but if there are any changes, we'll have to re-run all of CI anyway. So, either way...) |
166aa52 to
7a97e40Comparehumphd
commented
Apr 6, 2018
7a97e40 to
be70489CompareTrott
commented
Apr 6, 2018
@nodejs/fs @nodejs/testing |
Trott
commented
Apr 6, 2018
There was a problem hiding this comment.
As a general note: we can actually use the following instead:
assert.rejects(// `mode` can't be > 0o777()=>fchmod(handle,(0o777+1)),{code: 'ERR_OUT_OF_RANGE',name: 'RangeError [ERR_OUT_OF_RANGE]'});There was a problem hiding this comment.
Nit: can you please remove the console.log here?
There was a problem hiding this comment.
Shouldn't this be compared with buf2?
There was a problem hiding this comment.
Nit: Also, if we reduce magic numbers (like 11 in this case) it would be better.
There was a problem hiding this comment.
It would be better, if did this for chmod as well.
BridgeAR
commented
Apr 28, 2018
@humphd would you be so kind and have a look at the comments? :-) |
humphd
commented
Apr 28, 2018
@BridgeAR apologies for the delay. I'll update this week. |
be70489 to
d20bde9Comparehumphd
commented
Apr 30, 2018
OK, I've rebased and done the following based on the reviews above:
|
BridgeAR
commented
Apr 30, 2018
| await chmod(dest, 0o666); | ||
| await fchmod(handle, 0o666); | ||
| handle.chmod(0o666); |
There was a problem hiding this comment.
Indeed, thank you for spotting this. I'll fix.
addaleax
commented
May 5, 2018
OSX CI failure looks unrelated, opened #20660 New CI run: https://ci.nodejs.org/job/node-test-pull-request/14796/ |
Landed in fcc46ee 🎉 |
PR-URL: #19811 Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
PR-URL: #19811 Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
humphd
commented
May 15, 2018
Thanks for landing this @addaleax, and to the rest for your reviews and help spotting mistakes. |
I was looking at test coverage for the new things in
fs/promises.jsand wanted to add some more. This adds test cases usingFileHandleobjects vs. only using paths or fds.Due to #19057, I'm unable to run coverage locally on macOS; apologies for not including updated coverage info.