Skip to content
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

8.1.0-dev does not pass tests (EACCES error) #814

Closed
3 tasks done
breautek opened this issue Aug 21, 2019 · 3 comments
Closed
3 tasks done

8.1.0-dev does not pass tests (EACCES error) #814

breautek opened this issue Aug 21, 2019 · 3 comments

Comments

@breautek
Copy link
Contributor

breautek commented Aug 21, 2019

Bug Report

Problem

npm test fails

What is expected to happen?

npm test to run successfully

What does actually happen?

copyFile test suite has 2 tests, Test#001, and Test#002 that fails

copyFile
      ✗ Test#001 : should throw if source path not found (0.009 sec)
        - Expected function to throw an exception.
      ✗ Test#002 : should throw if src not in plugin directory (0.002 sec)
        - Error: EACCES: permission denied, open '/tmp/non_plugin_file'

Not sure if the 2 failures are a side effect of another or not.

Information

This is the full output starting with, omitting successful test lines.

rm: could not remove directory (code EACCES): /tmp/test_plugman/project/src

  common platform handler

    copyFile
      ✗ Test#001 : should throw if source path not found (0.009 sec)
        - Expected function to throw an exception.
      ✗ Test#002 : should throw if src not in plugin directory (0.002 sec)
        - Error: EACCES: permission denied, open '/tmp/non_plugin_file'
shell.js: internal error
Error: EACCES: permission denied, mkdir '/tmp/test_plugman/project/src/one'
    at Object.mkdirSync (fs.js:757:3)
    at mkdirSyncRecursive (/home/norman/development/cordova/cordova-android/node_modules/shelljs/src/mkdir.js:11:8)
    at mkdirSyncRecursive (/home/norman/development/cordova/cordova-android/node_modules/shelljs/src/mkdir.js:16:3)
    at mkdirSyncRecursive (/home/norman/development/cordova/cordova-android/node_modules/shelljs/src/mkdir.js:16:3)
    at /home/norman/development/cordova/cordova-android/node_modules/shelljs/src/mkdir.js:63:7
    at Array.forEach (<anonymous>)
    at Object._mkdir (/home/norman/development/cordova/cordova-android/node_modules/shelljs/src/mkdir.js:48:8)
    at Object.mkdir (/home/norman/development/cordova/cordova-android/node_modules/shelljs/src/common.js:186:23)
    at UserContext.<anonymous> (/home/norman/development/cordova/cordova-android/spec/unit/pluginHandlers/common.spec.js:57:19)
    at QueueRunner.attempt (/home/norman/development/cordova/cordova-android/node_modules/jasmine-core/lib/jasmine-core/jasmine.js:5505:44)

It appears to try to create something under /tmp/, but by default, /tmp is owned by root on my system, therefore in order for this to work, I'd have to use sudo. I don't think requiring sudo should be necessary here.

Command or Code

I recently clean my repo, so after merging upstream (apache/cordova-android/master) into my master I...

rm -r node_modules
npm install
npm test

Environment, Platform, Device

Cordova 9.0.0 (cordova-lib@9.0.1)
cordova-android 8.1.0-dev (current master)
node 10.16.0
Ubuntu 18.04

Version information

See above.

Checklist

  • I searched for existing GitHub issues
  • I updated all Cordova tooling to most recent version
  • I included all the necessary information above
@dpogue
Copy link
Member

dpogue commented Aug 21, 2019

hmm, do you know if this has ever worked on your machine? Was there a change that introduced this problem?

@breautek
Copy link
Contributor Author

breautek commented Aug 21, 2019

It has worked when I was working on gradle 5 upgrade PR. I'll crawl the commits to see which commit exactly broke this for me.

@breautek
Copy link
Contributor Author

Yah this is invalid. My bad. Once I looked into deeper I notice the files complaining were files that haven't been touched for the last 2 years.

It turned out that the files that the test was trying to access/create was already created under a different user, my work user account. Forcefully removing these temp files owned by my other user account allowed the test to run successfully.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants