Merge pull request #13020 from overleaf/mj-cypress-test-edit-separately

[web] Run cypress tests for editor separately

GitOrigin-RevId: f614fdb611ebd665aba08fc95efb3970c89a015e
This commit is contained in:
Mathias Jakobsen 2023-05-10 12:32:13 +01:00 committed by Copybot
parent b6877cb4dd
commit 11716cbd05
3 changed files with 11 additions and 8 deletions

View file

@ -150,21 +150,22 @@ test_frontend_ct:
build_test_frontend_ct: build_test_frontend_ct:
COMPOSE_PROJECT_NAME=frontend_test_ct_$(BUILD_DIR_NAME) $(DOCKER_COMPOSE) 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. # 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_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: 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) 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) run --rm test_frontend_ct
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) down -v -t 0
test_frontend_ct_modules: export CYPRESS_RESULTS=./cypress/results/modules test_frontend_ct_editor: export CYPRESS_RESULTS=./cypress/results/editor
test_frontend_ct_modules: export CYPRESS_SPEC_PATTERN=./modules/**/test/frontend/**/*.spec.{js,ts,tsx} test_frontend_ct_editor: export CYPRESS_SPEC_PATTERN=./test/frontend/features/source-editor/**/*.spec.{js,ts,tsx}
test_frontend_ct_modules: test_frontend_ct_editor:
COMPOSE_PROJECT_NAME=frontend_test_ct_modules_$(BUILD_DIR_NAME) $(DOCKER_COMPOSE) down -v -t 0 COMPOSE_PROJECT_NAME=frontend_test_ct_editor_$(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_editor_$(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 COMPOSE_PROJECT_NAME=frontend_test_ct_editor_$(BUILD_DIR_NAME) $(DOCKER_COMPOSE) down -v -t 0
# #
# Acceptance tests # Acceptance tests

View file

@ -21,6 +21,7 @@ export default defineConfig({
specPattern: specPattern:
process.env.CYPRESS_SPEC_PATTERN || process.env.CYPRESS_SPEC_PATTERN ||
'./{test,modules/**/test}/frontend/**/*.spec.{js,ts,tsx}', './{test,modules/**/test}/frontend/**/*.spec.{js,ts,tsx}',
excludeSpecPattern: process.env.CYPRESS_EXCLUDE_SPEC_PATTERN,
}, },
retries: { retries: {
runMode: 3, runMode: 3,

View file

@ -76,6 +76,7 @@ services:
entrypoint: bash entrypoint: bash
environment: environment:
CYPRESS_SPEC_PATTERN: ${CYPRESS_SPEC_PATTERN:-} CYPRESS_SPEC_PATTERN: ${CYPRESS_SPEC_PATTERN:-}
CYPRESS_EXCLUDE_SPEC_PATTERN: ${CYPRESS_EXCLUDE_SPEC_PATTERN:-}
volumes: volumes:
- ${CYPRESS_RESULTS:-./cypress/results}:/overleaf/services/web/cypress/results/ - ${CYPRESS_RESULTS:-./cypress/results}:/overleaf/services/web/cypress/results/
command: command: