Skip to content

Commit

Permalink
processor: run tests as root in the container
Browse files Browse the repository at this point in the history
- We need to install packages, compile ts, and move assets before running
the actual testing code.
- The `node` user doesn't have permessions to do anything of these
  tasks.
  • Loading branch information
AbdulrhmnGhanem committed Oct 14, 2022
1 parent 8087ff1 commit e563a9d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
1 change: 0 additions & 1 deletion processor/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,3 @@ RUN addgroup --gid 1000 node && \

USER node
CMD ["node", "dist/src/server.js"]

7 changes: 5 additions & 2 deletions scripts/clear_volumes_and_test_processor.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,11 @@ docker-compose down -v

# you can pass arguments to mocha e.g. `-g multi`
args="$(concatenate_args "$@")"

# We need to install packages, compile ts, and move assets before running the actual testing code.
# The `node` user doesn't have permessions to do anything of these tasks.
docker-compose run \
-u node \
-u root \
-e LOG_LEVEL=debug \
-e DATA_DIR=/data/test \
processor sh -c "whoami && stat /data /gitea-data /app"
processor sh -c "yarn install && yarn tsc && yarn cp-assets && yarn cp-test-assets && yarn test ${args}"

0 comments on commit e563a9d

Please sign in to comment.