-
Notifications
You must be signed in to change notification settings - Fork 29.1k
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: fix test-cli-permission tests when cwd contains /tmp #54188
test: fix test-cli-permission tests when cwd contains /tmp #54188
Conversation
`process.permission.has("fs")` checks if the process has permission for all files under `cwd`. Granting permission for `/tmp` and running tests with `cwd` containing `/tmp` will make the funtion return `true`, differing from expected results. Using relative paths ensures test paths are not `cwd` itself. Fixes: nodejs#54021
Differing from the other subdirectories of `/` `/tmp` has rwx permissions for all users. In the case where `firstPath` is `/tmp`, the last test case will fail, as it expects granting permission to `firstPath` will be failed. This commit skips the last test case when `firstPath` is `/tmp`. Fixes: nodejs#54021
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #54188 +/- ##
==========================================
- Coverage 87.09% 87.09% -0.01%
==========================================
Files 647 647
Lines 181836 181836
Branches 34917 34919 +2
==========================================
- Hits 158376 158372 -4
- Misses 16743 16744 +1
- Partials 6717 6720 +3 |
Commit Queue failed- Loading data for nodejs/node/pull/54188 ✔ Done loading data for nodejs/node/pull/54188 ----------------------------------- PR info ------------------------------------ Title test: fix test-cli-permission tests when cwd contains /tmp (#54188) ⚠ Could not retrieve the email or name of the PR author's from user's GitHub profile! Branch sendoru:fix-cli-permission-tests -> nodejs:main Labels test, author ready, needs-ci Commits 2 - test: use relative paths in test-cli-permission tests - test: skip the last test case when `/tmp` is `firstPath` Committers 1 - sendoru <[email protected]> PR-URL: https://github.com/nodejs/node/pull/54188 Fixes: https://github.com/nodejs/node/issues/54021 Reviewed-By: Antoine du Hamel <[email protected]> ------------------------------ Generated metadata ------------------------------ PR-URL: https://github.com/nodejs/node/pull/54188 Fixes: https://github.com/nodejs/node/issues/54021 Reviewed-By: Antoine du Hamel <[email protected]> -------------------------------------------------------------------------------- ℹ This PR was created on Sat, 03 Aug 2024 11:56:06 GMT ✔ Approvals: 1 ✔ - Antoine du Hamel (@aduh95) (TSC): https://github.com/nodejs/node/pull/54188#pullrequestreview-2220368323 ✔ Last GitHub CI successful ℹ Last Full PR CI on 2024-08-06T06:26:26Z: https://ci.nodejs.org/job/node-test-pull-request/60903/ - Querying data for job/node-test-pull-request/60903/ ✔ Last Jenkins CI successful -------------------------------------------------------------------------------- ✔ No git cherry-pick in progress ✔ No git am in progress ✔ No git rebase in progress -------------------------------------------------------------------------------- - Bringing origin/main up to date... From https://github.com/nodejs/node * branch main -> FETCH_HEAD ✔ origin/main is now up-to-date - Downloading patch for 54188 From https://github.com/nodejs/node * branch refs/pull/54188/merge -> FETCH_HEAD ✔ Fetched commits as 880c446d9558..615b1b714386 -------------------------------------------------------------------------------- [main 5cee9836ab] test: use relative paths in test-cli-permission tests Author: sendoru <[email protected]> Date: Sat Aug 3 19:56:52 2024 +0900 2 files changed, 12 insertions(+), 12 deletions(-) [main df03bd930f] test: skip the last test case when `/tmp` is `firstPath` Author: sendoru <[email protected]> Date: Sat Aug 3 20:34:14 2024 +0900 1 file changed, 3 insertions(+) ✔ Patches applied There are 2 commits in the PR. Attempting autorebase. Rebasing (2/4)https://github.com/nodejs/node/actions/runs/10381021102 |
Landed in 02b3095 |
`process.permission.has("fs")` checks if the process has permission for all files under `cwd`. Granting permission for `/tmp` and running tests with `cwd` containing `/tmp` will make the funtion return `true`, differing from expected results. Using relative paths ensures test paths are not `cwd` itself. Fixes: #54021 PR-URL: #54188 Reviewed-By: Antoine du Hamel <[email protected]>
`process.permission.has("fs")` checks if the process has permission for all files under `cwd`. Granting permission for `/tmp` and running tests with `cwd` containing `/tmp` will make the funtion return `true`, differing from expected results. Using relative paths ensures test paths are not `cwd` itself. Fixes: #54021 PR-URL: #54188 Reviewed-By: Antoine du Hamel <[email protected]>
`process.permission.has("fs")` checks if the process has permission for all files under `cwd`. Granting permission for `/tmp` and running tests with `cwd` containing `/tmp` will make the funtion return `true`, differing from expected results. Using relative paths ensures test paths are not `cwd` itself. Fixes: nodejs#54021 PR-URL: nodejs#54188 Reviewed-By: Antoine du Hamel <[email protected]>
`process.permission.has("fs")` checks if the process has permission for all files under `cwd`. Granting permission for `/tmp` and running tests with `cwd` containing `/tmp` will make the funtion return `true`, differing from expected results. Using relative paths ensures test paths are not `cwd` itself. Fixes: #54021 PR-URL: #54188 Reviewed-By: Antoine du Hamel <[email protected]>
Fixes: #54021