I’m trying to execute some tests with my node application, but after I make “npm install” (which runs fine), I run “npm test” I got some permission error (as you can see bellow):
Instead of copying the files to /home/node you might try the following:
steps:
- name: test
image: node
+ user: root
commands:
- npm install
- npm run test
The Drone workspace is a Docker volume and Docker volumes are owned by root. If your image set a default non-root users this can cause access problems to the volume.
This particular thread focuses on the issue where the default USER in an image is non-root, which causes problems due to the fact that docker volumes are owned by root. The example yaml you posted uses an alpine image, and has a default USER of root, which means the error message would be unrelated to this root cause.
With that being said, I tested your yaml and was unable to reproduce the problem [1][2]. Executing a shell script from the workspace is a common use case, and we have not received any reports of problems with this capability. This could perhaps indicate a problem with your host machine (is it possible you have apparmor or selinux configured in a way that could cause a problem? …)