-
-
Notifications
You must be signed in to change notification settings - Fork 75
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
Testing: Mode Assertions may be Failing #86
Comments
Investigating further it seems there is a mismatch between the test expectations and the intention of the code. The packing code always respects umask even if the mode is valid. This means that when the original file has umask permissions set, the above test case will fail. |
One option for working around this issue is #87 and the following patch. diff --git a/test/index.js b/test/index.js
index 3f5e07bb2af2..83b42d34cf18 100644
--- a/test/index.js
+++ b/test/index.js
@@ -20,7 +20,7 @@ test('copy a -> copy/a', function (t) {
rimraf.sync(b)
tar.pack(a)
- .pipe(tar.extract(b))
+ .pipe(tar.extract(b, { umask: 0 }))
.on('finish', function () {
var files = fs.readdirSync(b)
t.same(files.length, 1)
@@ -41,7 +41,7 @@ test('copy b -> copy/b', function (t) {
rimraf.sync(b)
tar.pack(a)
- .pipe(tar.extract(b))
+ .pipe(tar.extract(b, { umask: 0 }))
.on('finish', function () {
var files = fs.readdirSync(b)
t.same(files.length, 1) |
Wanna send a PR? |
See #87 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The mode assertion is failing in my environment.
First, is this line suppose respect any update to "test/fixtures/a/hello.txt"? Reading the test case it seems like this should be the case.
However, the assertion fails when the permissions of the (real) file "test/fixtures/a/hello.txt" is 0664. In my environment the "copy" file is still written with 0644 permissions.
--
OS: Ubuntu 18.04.3 LTS
Filesystem: ext4 / tmpfs
umask: 0022
The text was updated successfully, but these errors were encountered: