From cbe2a19dac3eafeec6342ef775121ffe0ad685b9 Mon Sep 17 00:00:00 2001 From: Jakob Ackermann Date: Tue, 17 Mar 2026 10:47:04 +0100 Subject: [PATCH] [server-ce] test: use ports 323x when running native cypress (#32182) GitOrigin-RevId: 7b826e33f47b59ba69a1def90ce05aecbcbb1cf5 --- server-ce/test/Makefile | 16 ++++++++-- server-ce/test/cypress.config.ts | 1 - server-ce/test/docker-compose.native.yml | 38 ++++++++++++++++++------ 3 files changed, 42 insertions(+), 13 deletions(-) diff --git a/server-ce/test/Makefile b/server-ce/test/Makefile index 9aa69ae005..a5180d4129 100644 --- a/server-ce/test/Makefile +++ b/server-ce/test/Makefile @@ -18,11 +18,21 @@ IMAGE_TAG_PRO_BASE := $(shell echo $(IMAGE_TAG_PRO) | sed -E s/:.+//) test-e2e-native: docker compose -f docker-compose.yml -f docker-compose.native.yml up --no-log-prefix sharelatex host-admin -d - CYPRESS_HOST_ADMIN_URL='http://localhost:8081' \ - CYPRESS_SAML_URL='http://localhost:8082' \ - CYPRESS_MAILTRAP_URL='http://localhost:8083' \ + CYPRESS_BASE_URL='http://127.0.0.1:3231' \ + CYPRESS_HOST_ADMIN_URL='http://127.0.0.1:3232' \ + CYPRESS_SAML_URL='http://127.0.0.1:3233' \ + CYPRESS_MAILTRAP_URL='http://127.0.0.1:3234' \ npm run cypress:open +# For testing "native" on Linux +test-e2e-native-linux: + docker compose -f docker-compose.yml -f docker-compose.native.yml up --no-log-prefix sharelatex host-admin -d + CYPRESS_BASE_URL='http://127.0.0.1:3231' \ + CYPRESS_HOST_ADMIN_URL='http://127.0.0.1:3232' \ + CYPRESS_SAML_URL='http://127.0.0.1:3233' \ + CYPRESS_MAILTRAP_URL='http://127.0.0.1:3234' \ + docker compose -f docker-compose.yml -f docker-compose.native.yml up --no-log-prefix cypress + test-e2e: docker compose build host-admin docker compose up --detach --wait host-admin diff --git a/server-ce/test/cypress.config.ts b/server-ce/test/cypress.config.ts index e42ef383a7..e04e8a5384 100644 --- a/server-ce/test/cypress.config.ts +++ b/server-ce/test/cypress.config.ts @@ -52,7 +52,6 @@ export default defineConfig({ viewportHeight: 768, viewportWidth: 1024, e2e: { - baseUrl: 'http://localhost', setupNodeEvents(on) { on('task', { readPdf, diff --git a/server-ce/test/docker-compose.native.yml b/server-ce/test/docker-compose.native.yml index d12c96d70c..c4d545c3f8 100644 --- a/server-ce/test/docker-compose.native.yml +++ b/server-ce/test/docker-compose.native.yml @@ -1,25 +1,45 @@ -version: "2.2" services: sharelatex: ports: - - "127.0.0.1:80:80" + - "127.0.0.1:3231:80" environment: - OVERLEAF_SITE_URL: "http://localhost" + OVERLEAF_SITE_URL: "http://127.0.0.1:3231" host-admin: ports: - - "127.0.0.1:8081:80" + - "127.0.0.1:3232:80" environment: NATIVE_CYPRESS: "true" - ACCESS_CONTROL_ALLOW_ORIGIN: "http://localhost" + ACCESS_CONTROL_ALLOW_ORIGIN: "http://127.0.0.1:3231" saml: ports: - - 127.0.0.1:8082:80 + - "127.0.0.1:3233:80" environment: - SAML_BASE_URL_PATH: "http://localhost:8082/simplesaml/" - SAML_TEST_SP_LOCATION: "http://localhost/saml/callback" + SAML_BASE_URL_PATH: "http://127.0.0.1:3233/simplesaml/" + SAML_TEST_SP_LOCATION: "http://127.0.0.1:3231/saml/callback" mailtrap: ports: - - 127.0.0.1:8083:80 + - "127.0.0.1:3234:80" + + # For testing "native" on Linux + cypress: + image: cypress/included:13.13.2 + volumes: + - ../../:/overleaf + - /tmp/.X11-unix:/tmp/.X11-unix + - ${XAUTHORITY:-/dev/null}:/home/node/.Xauthority + working_dir: /overleaf/server-ce/test + entrypoint: npm + command: run cypress:open + user: "${DOCKER_USER:-1000:1000}" + environment: + CI: + VERBOSE_LOGGING: + DISPLAY: ${DISPLAY:-:0} + CYPRESS_BASE_URL: + CYPRESS_HOST_ADMIN_URL: + CYPRESS_SAML_URL: + CYPRESS_MAILTRAP_URL: + network_mode: host