From 11716cbd051b04b608a839e37e04a3656d1f690a Mon Sep 17 00:00:00 2001 From: Mathias Jakobsen Date: Wed, 10 May 2023 12:32:13 +0100 Subject: [PATCH] Merge pull request #13020 from overleaf/mj-cypress-test-edit-separately [web] Run cypress tests for editor separately GitOrigin-RevId: f614fdb611ebd665aba08fc95efb3970c89a015e --- services/web/Makefile | 17 +++++++++-------- services/web/cypress.config.ts | 1 + services/web/docker-compose.ci.yml | 1 + 3 files changed, 11 insertions(+), 8 deletions(-) diff --git a/services/web/Makefile b/services/web/Makefile index e71ce004c2..0e22d924db 100644 --- a/services/web/Makefile +++ b/services/web/Makefile @@ -150,21 +150,22 @@ test_frontend_ct: build_test_frontend_ct: COMPOSE_PROJECT_NAME=frontend_test_ct_$(BUILD_DIR_NAME) $(DOCKER_COMPOSE) build test_frontend_ct # Note: The 2nd build should use the cache from the 1st build. - COMPOSE_PROJECT_NAME=frontend_test_ct_modules_$(BUILD_DIR_NAME) $(DOCKER_COMPOSE) build test_frontend_ct + COMPOSE_PROJECT_NAME=frontend_test_ct_editor_$(BUILD_DIR_NAME) $(DOCKER_COMPOSE) build test_frontend_ct test_frontend_ct_core: export CYPRESS_RESULTS=./cypress/results/core -test_frontend_ct_core: export CYPRESS_SPEC_PATTERN=./test/frontend/**/*.spec.{js,ts,tsx} +test_frontend_ct_core: export CYPRESS_SPEC_PATTERN=./{test,modules/**/test}/frontend/**/*.spec.{js,ts,tsx} +test_frontend_ct_core: export CYPRESS_EXCLUDE_SPEC_PATTERN=./test/frontend/features/source-editor/**/*.spec.{js,ts,tsx} test_frontend_ct_core: COMPOSE_PROJECT_NAME=frontend_test_ct_$(BUILD_DIR_NAME) $(DOCKER_COMPOSE) down -v -t 0 COMPOSE_PROJECT_NAME=frontend_test_ct_$(BUILD_DIR_NAME) $(DOCKER_COMPOSE) run --rm test_frontend_ct COMPOSE_PROJECT_NAME=frontend_test_ct_$(BUILD_DIR_NAME) $(DOCKER_COMPOSE) down -v -t 0 -test_frontend_ct_modules: export CYPRESS_RESULTS=./cypress/results/modules -test_frontend_ct_modules: export CYPRESS_SPEC_PATTERN=./modules/**/test/frontend/**/*.spec.{js,ts,tsx} -test_frontend_ct_modules: - COMPOSE_PROJECT_NAME=frontend_test_ct_modules_$(BUILD_DIR_NAME) $(DOCKER_COMPOSE) down -v -t 0 - COMPOSE_PROJECT_NAME=frontend_test_ct_modules_$(BUILD_DIR_NAME) $(DOCKER_COMPOSE) run --rm test_frontend_ct - COMPOSE_PROJECT_NAME=frontend_test_ct_modules_$(BUILD_DIR_NAME) $(DOCKER_COMPOSE) down -v -t 0 +test_frontend_ct_editor: export CYPRESS_RESULTS=./cypress/results/editor +test_frontend_ct_editor: export CYPRESS_SPEC_PATTERN=./test/frontend/features/source-editor/**/*.spec.{js,ts,tsx} +test_frontend_ct_editor: + COMPOSE_PROJECT_NAME=frontend_test_ct_editor_$(BUILD_DIR_NAME) $(DOCKER_COMPOSE) down -v -t 0 + COMPOSE_PROJECT_NAME=frontend_test_ct_editor_$(BUILD_DIR_NAME) $(DOCKER_COMPOSE) run --rm test_frontend_ct + COMPOSE_PROJECT_NAME=frontend_test_ct_editor_$(BUILD_DIR_NAME) $(DOCKER_COMPOSE) down -v -t 0 # # Acceptance tests diff --git a/services/web/cypress.config.ts b/services/web/cypress.config.ts index 412a197841..7f1a992ffa 100644 --- a/services/web/cypress.config.ts +++ b/services/web/cypress.config.ts @@ -21,6 +21,7 @@ export default defineConfig({ specPattern: process.env.CYPRESS_SPEC_PATTERN || './{test,modules/**/test}/frontend/**/*.spec.{js,ts,tsx}', + excludeSpecPattern: process.env.CYPRESS_EXCLUDE_SPEC_PATTERN, }, retries: { runMode: 3, diff --git a/services/web/docker-compose.ci.yml b/services/web/docker-compose.ci.yml index f6a14969d3..a014963d47 100644 --- a/services/web/docker-compose.ci.yml +++ b/services/web/docker-compose.ci.yml @@ -76,6 +76,7 @@ services: entrypoint: bash environment: CYPRESS_SPEC_PATTERN: ${CYPRESS_SPEC_PATTERN:-} + CYPRESS_EXCLUDE_SPEC_PATTERN: ${CYPRESS_EXCLUDE_SPEC_PATTERN:-} volumes: - ${CYPRESS_RESULTS:-./cypress/results}:/overleaf/services/web/cypress/results/ command: