From 0e09c25a976216a7b18d0f92208fca137ee53c75 Mon Sep 17 00:00:00 2001 From: Alf Eaton Date: Mon, 31 Oct 2022 09:37:25 +0000 Subject: [PATCH] Run Cypress interactive UI in Docker (#9954) Co-authored-by: Eric Mc Sween GitOrigin-RevId: 51e7149cf10475c229d6e7a9ae8cf5694002d27b --- services/web/docker-compose.cypress.yml | 12 ++++++++++++ services/web/package.json | 2 ++ 2 files changed, 14 insertions(+) create mode 100644 services/web/docker-compose.cypress.yml diff --git a/services/web/docker-compose.cypress.yml b/services/web/docker-compose.cypress.yml new file mode 100644 index 0000000000..07e8891fdd --- /dev/null +++ b/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.*" diff --git a/services/web/package.json b/services/web/package.json index 217521ae4b..15577dda21 100644 --- a/services/web/package.json +++ b/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",