Skip to content

test: add tests for fsPromises.chown to increase coverage - #20574

Closed
shisama wants to merge 4 commits into
nodejs:masterfrom
shisama:test-fs-promises-chown
Closed

test: add tests for fsPromises.chown to increase coverage#20574
shisama wants to merge 4 commits into
nodejs:masterfrom
shisama:test-fs-promises-chown

Conversation

@shisama

Copy link
Copy Markdown
Contributor

To increase test coverage for fs/promises, add tests for
methods chown(), filehandle.chown() and lchown().

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • commit message follows commit guidelines

@nodejs-github-botnodejs-github-bot added the test Issues and PRs related to the tests. label May 7, 2018
@ChALkeRChALkeR added experimental Issues and PRs related to experimental features. fs Issues and PRs related to the fs subsystem / file system. labels May 8, 2018
@BridgeAR

Copy link
Copy Markdown
Member

@BridgeARBridgeAR added author ready PRs that have at least one approval, no pending requests for changes, and a CI started. and removed author ready PRs that have at least one approval, no pending requests for changes, and a CI started. labels May 18, 2018
Comment threadtest/parallel/test-fs-promises.js Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

process.getuid() and process.getgid() are not defined on Windows.

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

@cjihrig
Thank you for your review.
Fixed not to call the process.getuid() and process.getgid() on Windows.

Trott
Trott previously requested changes May 21, 2018

@TrottTrott left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

These tests seem to fail just about everywhere in CI...

@shisama
shisamaforce-pushed the test-fs-promises-chown branch from e7b2fdf to b4fd185CompareMay 22, 2018 07:18
@Trott

Trott commented May 22, 2018

Copy link
Copy Markdown
Member

@cjihrig
cjihrig dismissed Trott’s stale reviewMay 22, 2018 18:59

because they said we could

@Trott

Copy link
Copy Markdown
Member

Rather than skipping on Windows, should we check that we get the right expected error when on Windows?

Trott
Trott previously requested changes May 22, 2018

@TrottTrott left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Tests still failing on most platforms:

15:19:05 not ok 584 parallel/test-fs-promises15:19:05 ---15:19:05 duration_ms: 0.17115:19:05 severity: fail15:19:05 exitcode: 115:19:05 stack: |-15:19:05 (node:4855) ExperimentalWarning: The fs.promises API is experimental15:19:05 /home/iojs/build/workspace/node-test-commit-linux/nodes/ubuntu1804-docker/test/common/index.js:79815: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 ...

@shisamashisama changed the title test: add tests for fs/promises chown to increase coveragetest: add tests for fsPromises.chown to increase coverageMay 23, 2018
@shisama

Copy link
Copy Markdown
ContributorAuthor

@Trott
Thank you for your review.

I missed the doc indicates that the fsPromises.lchown is only implemented on macOS.
Doc: https://nodejs.org/api/fs.html#fs_fspromises_lchown_path_uid_gid

I fixed the method is only called on macOS.

@Trott

Trott commented May 23, 2018

Copy link
Copy Markdown
Member

@jasnell

Copy link
Copy Markdown
Member

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/

@shisama

Copy link
Copy Markdown
ContributorAuthor

@jasnell
I think node-test-commit-linux failure is a flaky failure.
See #20907

Is the failure of node-test-commit-windows-fanned build bot failure?
This is happened on some PullRequest.

@jasnell

Copy link
Copy Markdown
Member

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.

@mhdawsonmhdawson left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM

@BridgeAR

Copy link
Copy Markdown
Member

@Trott PTAL. I just checked the CI and added a green check mark next to the CI that you started.

@Trott

Copy link
Copy Markdown
Member

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).

@Trott

Copy link
Copy Markdown
Member

(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
shisamaforce-pushed the test-fs-promises-chown branch from 511e744 to 0e3a4caCompareMay 31, 2018 03:36
@shisama
shisamaforce-pushed the test-fs-promises-chown branch 2 times, most recently from a41e746 to 8041fa3CompareJune 12, 2018 00:59
@shisama
shisamaforce-pushed the test-fs-promises-chown branch from 8041fa3 to 012b2ccCompareJune 21, 2018 15:56
@shisama

Copy link
Copy Markdown
ContributorAuthor

@Trott CI failure is that parallel/test-net-bytes-per-incoming-chunk-overhead is timeout. It is related to #21322 ?

@Trott

Copy link
Copy Markdown
Member

@Trott CI failure is that parallel/test-net-bytes-per-incoming-chunk-overhead is timeout. It is related to #21322 ?

@shisama Yes, it would seem to be.

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

@apapirovski

Copy link
Copy Markdown
Contributor

@Trott@mhdawson@cjihrig@jasnell@BridgeAR please have another look. In particular @Trott who is currently blocking this PR. Thanks!

Comment threadtest/parallel/test-fs-promises.js Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

If #21498 lands, this could become !common.isWindows.

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

Fixed it. Thanks.

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

@cjihrig PTAL Thanks.

@Trott
Trott dismissed their stale reviewJune 26, 2018 05:15

ci is green now, clearing my objection

@shisama
shisamaforce-pushed the test-fs-promises-chown branch from f2d508b to 345ddc5CompareJuly 1, 2018 14:12
@TimothyGuTimothyGu added the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label Jul 30, 2018
shisama added 4 commits July 29, 2018 20:39
To increase test coverage for fs/promises, add tests for
methods chown(), filehandle.chown() and lchown().
Fix not to call `process.getuid()` and `process.getgid()` on Windows.
Add error tests for fsPromises.chown and FileHandle.chown on all
platforms.
@TimothyGu
TimothyGuforce-pushed the test-fs-promises-chown branch from 345ddc5 to b1183acCompareJuly 30, 2018 00:41
@TimothyGu

Copy link
Copy Markdown
Member

Rebased.

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

@TimothyGuTimothyGu self-assigned this Jul 30, 2018
@TimothyGu

Copy link
Copy Markdown
Member

@TimothyGu

Copy link
Copy Markdown
Member

Landed in a4ce449.

@TimothyGuTimothyGu removed the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label Jul 30, 2018
TimothyGu pushed a commit that referenced this pull request Jul 30, 2018
To increase test coverage for fs/promises, add tests for
methods chown(), filehandle.chown() and lchown().
PR-URL: #20574
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Reviewed-By: Сковорода Никита Андреевич <chalkerx@gmail.com>
Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com>
targos pushed a commit that referenced this pull request Jul 31, 2018
To increase test coverage for fs/promises, add tests for
methods chown(), filehandle.chown() and lchown().
PR-URL: #20574
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Reviewed-By: Сковорода Никита Андреевич <chalkerx@gmail.com>
Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com>
@targostargos mentioned this pull request Jul 31, 2018
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

experimentalIssues and PRs related to experimental features.fsIssues and PRs related to the fs subsystem / file system.testIssues and PRs related to the tests.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

10 participants

@shisama@BridgeAR@Trott@jasnell@apapirovski@TimothyGu@ChALkeR@cjihrig@mhdawson@nodejs-github-bot