Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign uptest: add tests for fsPromises.chown to increase coverage #20574
Conversation
nodejs-github-bot
added
the
test
label
May 7, 2018
ChALkeR
added
experimental
fs
labels
May 8, 2018
BridgeAR
approved these changes
May 18, 2018
This comment has been minimized.
This comment has been minimized.
BridgeAR
added
author ready
and removed
author ready
labels
May 18, 2018
jasnell
approved these changes
May 19, 2018
cjihrig
reviewed
May 21, 2018
| @@ -96,6 +98,9 @@ function verifyStatObject(stat) { | |||
| await chmod(dest, 0o666); | |||
| await fchmod(handle, 0o666); | |||
|
|
|||
| await chown(dest, process.getuid(), process.getgid()); | |||
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
shisama
May 22, 2018
Author
Contributor
@cjihrig
Thank you for your review.
Fixed not to call the process.getuid() and process.getgid() on Windows.
Trott
reviewed
May 21, 2018
|
These tests seem to fail just about everywhere in CI... |
shisama
force-pushed the
shisama:test-fs-promises-chown
branch
from
e7b2fdf
to
b4fd185
May 22, 2018
This comment has been minimized.
This comment has been minimized.
cjihrig
approved these changes
May 22, 2018
cjihrig
dismissed
Trott’s
stale review
May 22, 2018
because they said we could
This comment has been minimized.
This comment has been minimized.
|
Rather than skipping on Windows, should we check that we get the right expected error when on Windows? |
Trott
reviewed
May 22, 2018
|
Tests still failing on most platforms: 15:19:05 not ok 584 parallel/test-fs-promises
15:19:05 ---
15:19:05 duration_ms: 0.171
15:19:05 severity: fail
15:19:05 exitcode: 1
15:19:05 stack: |-
15:19:05 (node:4855) ExperimentalWarning: The fs.promises API is experimental
15:19:05 /home/iojs/build/workspace/node-test-commit-linux/nodes/ubuntu1804-docker/test/common/index.js:798
15:19:05 (err) => process.nextTick(() => { throw err; }));
15:19:05 ^
15:19:05
15:19:05 AssertionError [ERR_ASSERTION]: Code: ERR_METHOD_NOT_IMPLEMENTED; The provided arguments length (0) does not match the required ones (1).
15:19:05 at getMessage (internal/errors.js:223:3)
15:19:05 at new NodeError (internal/errors.js:156:13)
15:19:05 at lchown (internal/fs/promises.js:383:11)
15:19:05 at doTest (/home/iojs/build/workspace/node-test-commit-linux/nodes/ubuntu1804-docker/test/parallel/test-fs-promises.js:140:15)
15:19:05 ... |
shisama
changed the title
test: add tests for fs/promises chown to increase coverage
test: add tests for fsPromises.chown to increase coverage
May 23, 2018
This comment has been minimized.
This comment has been minimized.
|
@Trott I missed the doc indicates that the fsPromises.lchown is only implemented on macOS. I fixed the method is only called on macOS. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
Lots of red in the new CI run. Some are flaky failures, some are build bot failures, some are potentially related.... CI seems rather iffy these days... running again: https://ci.nodejs.org/job/node-test-pull-request/15056/ |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
yeah, CI in general is in rough shape right now. Let's give it another day or so to see if we can get those issues figured out then give this another run. |
This comment has been minimized.
This comment has been minimized.
|
@Trott PTAL. I just checked the CI and added a green check mark next to the CI that you started. |
This comment has been minimized.
This comment has been minimized.
|
CI: https://ci.nodejs.org/job/node-test-pull-request/15174/ If CI is green or yellow, feel free to clear my objection (although it looks like this needs a rebase and that will probably mean another CI after the rebase). |
This comment has been minimized.
This comment has been minimized.
|
(And again, I'd prefer that we don't skip the test on unsupported platforms but instead check that we get the expected error. This will help prevent us from making changes that introduce cryptic unhelpful errors by accident. But this is a suggestion and I'm certainly not going to block this on it. It's also something that can be added in a subsequent PR.) |
shisama
force-pushed the
shisama:test-fs-promises-chown
branch
from
511e744
to
0e3a4ca
May 31, 2018
shisama
force-pushed the
shisama:test-fs-promises-chown
branch
2 times, most recently
from
a41e746
to
8041fa3
Jun 11, 2018
shisama
force-pushed the
shisama:test-fs-promises-chown
branch
from
8041fa3
to
012b2cc
Jun 21, 2018
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
cjihrig
reviewed
Jun 25, 2018
| @@ -133,6 +162,9 @@ function verifyStatObject(stat) { | |||
| if (common.canCreateSymLink()) { | |||
| const newLink = path.resolve(tmpDir, 'baz3.js'); | |||
| await symlink(newPath, newLink); | |||
| if (common.isOSX) { | |||
| await lchown(newLink, process.getuid(), process.getgid()); | |||
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Trott
dismissed
their
stale review
Jun 26, 2018
ci is green now, clearing my objection
shisama
force-pushed the
shisama:test-fs-promises-chown
branch
from
f2d508b
to
345ddc5
Jul 1, 2018
ChALkeR
approved these changes
Jul 1, 2018
TimothyGu
added
the
author ready
label
Jul 30, 2018
shisama
added some commits
May 7, 2018
TimothyGu
approved these changes
Jul 30, 2018
TimothyGu
force-pushed the
shisama:test-fs-promises-chown
branch
from
345ddc5
to
b1183ac
Jul 30, 2018
This comment has been minimized.
This comment has been minimized.
TimothyGu
self-assigned this
Jul 30, 2018
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
Landed in a4ce449. |
shisama commentedMay 7, 2018
To increase test coverage for fs/promises, add tests for
methods chown(), filehandle.chown() and lchown().
Checklist
make -j4 test(UNIX), orvcbuild test(Windows) passes