Skip to content

Commit

Permalink
run unit tests and playwright in separate images
Browse files Browse the repository at this point in the history
  • Loading branch information
Valeri Kuzmin, Vadim Vohmjanin committed Aug 24, 2023
1 parent cd3898c commit 26b8311
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
7 changes: 6 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM mcr.microsoft.com/playwright:v1.34.0-jammy as build
FROM node:18-alpine as build

ENV DUMP_CHROME_OUT=true
ENV TEST_CHROME_ARGS='--no-sandbox --disable-dev-shm-usage --disable-gpu --disable-gpu-compositing --disable-gpu-rasterization'
Expand All @@ -15,6 +15,11 @@ RUN npm run build:server
ARG PROJECTS_FILE=''
RUN [ -e "$PROJECTS_FILE" ] && cp -f "$PROJECTS_FILE" build/projects.json || true

FROM mcr.microsoft.com/playwright:v1.37.0-jammy as e2e

WORKDIR /app
COPY --from=build /app /app

FROM node:18-alpine

WORKDIR /app
Expand Down
4 changes: 3 additions & 1 deletion Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ pipeline {
GOOGLE_CLIENT_ID = credentials('GOOGLE_CLIENT_ID')
GOOGLE_CLIENT_SECRET = credentials('GOOGLE_CLIENT_SECRET')
COOKIE_SECRET = credentials('COOKIE_SECRET')
PROJECT_GITHUB = credentials('PROJECT_GITHUB')
}

stages {
Expand All @@ -21,7 +22,8 @@ pipeline {
}
stage('E2E Test') {
steps {
sh 'docker run ${REPO_NAME}_build e2e/run.sh'
sh 'docker build --target e2e -t ${REPO_NAME}_e2e .'
sh 'docker run ${REPO_NAME}_e2e e2e/run.sh'
}
}
stage('Build final') {
Expand Down
3 changes: 1 addition & 2 deletions e2e/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@

cd `dirname $0`

npm ci
npx playwright install-deps
# npx playwright install-deps

cp -r i18n ../build
cd ../build
Expand Down

0 comments on commit 26b8311

Please sign in to comment.