Skip to content

Commit

Permalink
refact: switched from using synthetixio/docker-e2e base image to manu…
Browse files Browse the repository at this point in the history
…al installation of NodeJS and other dependencies in Dockerfile
  • Loading branch information
rabi-siddique committed Mar 19, 2024
1 parent c60192c commit 4e07943
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 5 deletions.
14 changes: 11 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,17 @@
# syntax=docker/dockerfile:1
FROM --platform=linux/amd64 synthetixio/docker-e2e:18.16-ubuntu as base
FROM node:18.6

# Install chrome and necessary dependencies
RUN apt-get update \
&& apt-get install -y wget gnupg ca-certificates jq \
&& wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - \
&& sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google-chrome.list' \
&& apt-get update \
&& apt-get install -y google-chrome-stable


# Project setup
RUN mkdir /app
WORKDIR /app

COPY . .

RUN yarn install --frozen-lockfile
19 changes: 18 additions & 1 deletion test/e2e/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,14 @@ services:
- SECRET_WORDS="orbit bench unit task food shock brand bracket domain regular warfare company announce wheel grape trust sphere boy doctor half guard ritual three ecology"
depends_on:
- display
- video
entrypoint: []
working_dir: /app
volumes:
- ./cypress/videos:/app/test/e2e/videos
- ./cypress/screenshots:/app/test/e2e/screenshots
command: >
bash -c 'echo -n "======> local noVNC URL: http://localhost:8080/vnc.html?autoconnect=true " && pnpm wait-on http://display:8080 && echo -n "======> remote noVNC URL: " && curl -s ngrok:4040/api/tunnels | jq -r .tunnels[0].public_url && yarn test:e2e:ci'
bash -c 'echo -n "======> local noVNC URL: http://localhost:8080/vnc.html?autoconnect=true " && yarn wait-on http://display:8080 && echo -n "======> remote noVNC URL: " && curl -s ngrok:4040/api/tunnels | jq -r .tunnels[0].public_url && yarn test:e2e:ci'
networks:
- x11

Expand Down Expand Up @@ -77,5 +78,21 @@ services:
networks:
- x11

video:
profiles:
- synpress
container_name: video
image: synthetixio/video:457bb48776c3b14de232d9dda620ba9188dc40ac-base
volumes:
- ./cypress/videos:/videos
environment:
- FILE_NAME=CI-full-video.mp4
- SE_SCREEN_WIDTH=1920
- SE_SCREEN_HEIGHT=1080
depends_on:
- display
networks:
- x11

networks:
x11:
2 changes: 1 addition & 1 deletion test/e2e/synpress.config.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ module.exports = defineConfig({
...config,
e2e: {
...config.e2e,
baseUrl: 'http://localhost:3000',
baseUrl: 'http://localhost:3001',
specPattern: 'test/e2e/specs/**/*spec.{js,jsx,ts,tsx}',
supportFile: 'test/support.js',
screenshotsFolder: 'test/e2e/screenshots',
Expand Down

0 comments on commit 4e07943

Please sign in to comment.