Ver Fonte

Run Cypress interactive UI in Docker (#9954)

Co-authored-by: Eric Mc Sween <eric.mcsween@overleaf.com>
GitOrigin-RevId: 51e7149cf10475c229d6e7a9ae8cf5694002d27b
Alf Eaton há 3 anos atrás
pai
commit
0e09c25a97
2 ficheiros alterados com 14 adições e 0 exclusões
  1. 12 0
      services/web/docker-compose.cypress.yml
  2. 2 0
      services/web/package.json

+ 12 - 0
services/web/docker-compose.cypress.yml

@@ -0,0 +1,12 @@
+services:
+  cypress:
+    image: cypress/included:10.9.0
+    volumes:
+      - ../../:/overleaf
+      - /tmp/.X11-unix:/tmp/.X11-unix
+    working_dir: /overleaf/services/web
+    entrypoint: npm
+    user: "${DOCKER_USER:-1000:1000}"
+    environment:
+      - "DISPLAY=${DISPLAY:-:0}"
+#      - "DEBUG=cypress.*"

+ 2 - 0
services/web/package.json

@@ -34,6 +34,8 @@
     "convert-themes": "node modules/source-editor/frontend/js/themes/convert.js",
     "cypress:open-ct": "SHARELATEX_CONFIG=$PWD/config/settings.webpack.js cypress open --component",
     "cypress:run-ct": "SHARELATEX_CONFIG=$PWD/config/settings.webpack.js cypress run --component",
+    "cypress:docker:open-ct": "DOCKER_USER=\"$(id -u):$(id -g)\" docker-compose -f docker-compose.cypress.yml run --rm cypress run cypress:open-ct",
+    "cypress:docker:run-ct": "DOCKER_USER=\"$(id -u):$(id -g)\" docker-compose -f docker-compose.cypress.yml run --rm cypress run cypress:run-ct",
     "lezer-latex:generate": "if [ ! -d $(pwd)/modules/source-editor ]; then echo \"'source-editor' module is not available\"; exit 0; fi; node modules/source-editor/scripts/lezer-latex/generate.js",
     "lezer-latex:run": "node modules/source-editor/scripts/lezer-latex/run.mjs",
     "lezer-latex:benchmark": "node modules/source-editor/scripts/lezer-latex/benchmark.mjs",