mirror of
https://github.com/opf/openproject.git
synced 2026-06-13 19:20:00 +00:00
Enable frontend unit tests in docker (#9480)
* Enable frontend unit tests in docker * Update npm command names
This commit is contained in:
+2
-1
@@ -116,12 +116,13 @@ services:
|
||||
frontend-test:
|
||||
build:
|
||||
<<: *frontend-build
|
||||
command: "npm run serve-test"
|
||||
command: "npm run serve:test"
|
||||
volumes:
|
||||
- ".:/home/dev/openproject"
|
||||
- "fedata-test:/home/dev/openproject/public/assets/frontend"
|
||||
environment:
|
||||
PROXY_HOSTNAME: backend-test
|
||||
CHROME_BIN: chromium
|
||||
networks:
|
||||
- testing
|
||||
|
||||
|
||||
@@ -6,6 +6,8 @@ ARG DEV_GID=1001
|
||||
|
||||
ENV USER=dev
|
||||
|
||||
RUN apt-get update && apt-get install -y chromium
|
||||
|
||||
RUN npm i -g npm
|
||||
|
||||
# `--no-log-init` is required as a workaround to avoid disk exhaustion.
|
||||
@@ -13,10 +15,10 @@ RUN npm i -g npm
|
||||
# Read more at:
|
||||
# * https://docs.docker.com/develop/develop-images/dockerfile_best-practices/#user
|
||||
# * https://github.com/golang/go/issues/13548
|
||||
RUN useradd --no-log-init -d /home/$USER -m $USER -g node
|
||||
RUN useradd --no-log-init -d /home/$USER -m $USER -g node || true
|
||||
|
||||
RUN usermod -u $DEV_UID $USER
|
||||
RUN groupadd $USER
|
||||
RUN usermod -u $DEV_UID $USER || true
|
||||
RUN groupadd $USER || true
|
||||
RUN groupmod -g $DEV_GID $USER || true
|
||||
|
||||
EXPOSE 4200
|
||||
|
||||
@@ -131,13 +131,13 @@
|
||||
"analyze": "ng build --configuration production --stats-json && webpack-bundle-analyzer -h 0.0.0.0 -p 9999 ../public/assets/frontend/stats.json",
|
||||
"prebuild": "./scripts/link_plugin_placeholder.js",
|
||||
"build": "node --max_old_space_size=4096 ./node_modules/@angular/cli/bin/ng build --configuration production --named-chunks --extract-css --source-map",
|
||||
"build-watch": "node --max_old_space_size=4096 ./node_modules/@angular/cli/bin/ng build --watch --named-chunks --extract-css",
|
||||
"build:watch": "node --max_old_space_size=4096 ./node_modules/@angular/cli/bin/ng build --watch --named-chunks --extract-css",
|
||||
"preserve": "./scripts/link_plugin_placeholder.js",
|
||||
"serve": "node --max_old_space_size=8096 ./node_modules/@angular/cli/bin/ng serve --host 0.0.0.0 --public-host http://localhost:4200",
|
||||
"serve-test": "node --max_old_space_size=8096 ./node_modules/@angular/cli/bin/ng serve --host 0.0.0.0 --disable-host-check --public-host http://frontend-test:4200",
|
||||
"serve:test": "node --max_old_space_size=8096 ./node_modules/@angular/cli/bin/ng serve --host 0.0.0.0 --disable-host-check --public-host http://frontend-test:4200",
|
||||
"pretest": "./scripts/link_plugin_placeholder.js",
|
||||
"test": "ng test --watch=false",
|
||||
"test-watch": "ng test --watch=true",
|
||||
"test:watch": "ng test --watch=true",
|
||||
"lint": "eslint -c .eslintrc.js --ext .ts src/app/",
|
||||
"lint:fix": "esprint check --fix",
|
||||
"generate-typings": "tsc -d -p src/tsconfig.app.json"
|
||||
|
||||
+1
-1
@@ -6,7 +6,7 @@
|
||||
"test": "cd frontend && npm test && cd ..",
|
||||
"tslint_typechecks": "cd frontend && npm run tslint_typechecks && cd ..",
|
||||
"serve": "cd frontend && npm run serve",
|
||||
"serve-public": "cd frontend && ./node_modules/.bin/ng serve --host 0.0.0.0"
|
||||
"serve:public": "cd frontend && ./node_modules/.bin/ng serve --host 0.0.0.0"
|
||||
},
|
||||
"private": true,
|
||||
"engines": {
|
||||
|
||||
Reference in New Issue
Block a user