diff --git a/services/web/Jenkinsfile b/services/web/Jenkinsfile index 739484a95e..b73281d61e 100644 --- a/services/web/Jenkinsfile +++ b/services/web/Jenkinsfile @@ -279,7 +279,7 @@ pipeline { stages { stage('Wait a bit to give tests all the CPU capacity') { steps { - sh 'sleep 90' + sh 'sleep 60' } } stage('Build Webpack') { @@ -330,6 +330,13 @@ pipeline { } } } + stage('Push Production image early') { + steps { + dir('services/web') { + sh 'make push_scratch' + } + } + } } } } diff --git a/services/web/Makefile b/services/web/Makefile index 3a836f7be7..fdbdd4a470 100644 --- a/services/web/Makefile +++ b/services/web/Makefile @@ -183,21 +183,26 @@ test_writefull: build_test_frontend_ct: docker run --rm --volume /dev/shm:/dev/shm --user root $(IMAGE_CI) bash -ec 'for path in /overleaf/services/web/cypress/results /overleaf/services/web/node_modules/.cache; do mkdir -p $$path; chown -R node:node $$path; done && tar -cC / overleaf | tar -xC /dev/shm' +test_frontend_ct_core_other: export CYPRESS_DOWNLOADS=./cypress/downloads/core test_frontend_ct_core_other: export CYPRESS_RESULTS=./cypress/results/core test_frontend_ct_core_other: export CYPRESS_SPEC_PATTERN=./test/frontend/**/*.spec.{js,jsx,ts,tsx} test_frontend_ct_core_other: export CYPRESS_EXCLUDE_SPEC_PATTERN=./test/frontend/features/**/*.spec.{js,jsx,ts,tsx} +test_frontend_ct_core_features: export CYPRESS_DOWNLOADS=./cypress/downloads/core test_frontend_ct_core_features: export CYPRESS_RESULTS=./cypress/results/core test_frontend_ct_core_features: export CYPRESS_SPEC_PATTERN=./test/frontend/features/**/*.spec.{js,jsx,ts,tsx} test_frontend_ct_core_features: export CYPRESS_EXCLUDE_SPEC_PATTERN=./test/frontend/features/source-editor/**/*.spec.{js,jsx,ts,tsx} +test_frontend_ct_modules: export CYPRESS_DOWNLOADS=./cypress/downloads/modules test_frontend_ct_modules: export CYPRESS_RESULTS=./cypress/results/modules test_frontend_ct_modules: export CYPRESS_SPEC_PATTERN=./modules/**/test/frontend/**/*.spec.{js,jsx,ts,tsx} +test_frontend_ct_editor_other: export CYPRESS_DOWNLOADS=./cypress/downloads/editor_other test_frontend_ct_editor_other: export CYPRESS_RESULTS=./cypress/results/editor_other test_frontend_ct_editor_other: export CYPRESS_SPEC_PATTERN=./test/frontend/features/source-editor/**/*.spec.{js,jsx,ts,tsx} test_frontend_ct_editor_other: export CYPRESS_EXCLUDE_SPEC_PATTERN=./test/frontend/features/source-editor/components/codemirror-editor-visual*.spec.{js,jsx,ts,tsx} +test_frontend_ct_editor_visual: export CYPRESS_DOWNLOADS=./cypress/downloads/editor_visual test_frontend_ct_editor_visual: export CYPRESS_RESULTS=./cypress/results/editor_visual test_frontend_ct_editor_visual: export CYPRESS_SPEC_PATTERN=./test/frontend/features/source-editor/components/codemirror-editor-visual*.spec.{js,jsx,ts,tsx} @@ -547,6 +552,10 @@ shellcheck_fix: IMAGE_CI ?= ci/$(PROJECT_NAME):$(BRANCH_NAME)-$(BUILD_NUMBER) IMAGE_REPO ?= us-east1-docker.pkg.dev/overleaf-ops/ol-docker/$(PROJECT_NAME) IMAGE_REPO_FINAL ?= $(IMAGE_REPO):$(BRANCH_NAME)-$(BUILD_NUMBER) +# A shared scratch tag that is used by all the pipelines for pushing the layers of the production image ASAP from a parallel step. +# We do not want to make the image available before all the tests have passed. +# Using a single tag avoids generating cruft in our docker repository / AR. +IMAGE_SCRATCH ?= $(IMAGE_REPO):do-not-use-this-tag-for-deploys--it-is-used-for-early-pushes-in-ci IMAGE_CACHE ?= $(IMAGE_REPO):cache-$(shell cat \ $(MONOREPO)/package.json \ $(MONOREPO)/package-lock.json \ @@ -613,6 +622,7 @@ build: docker build \ --build-arg SENTRY_RELEASE \ --tag $(IMAGE_REPO_FINAL) \ + --tag $(IMAGE_SCRATCH) \ --target app \ --file Dockerfile \ ../.. @@ -623,6 +633,9 @@ publish: push_branch: docker push $(IMAGE_CACHE) +push_scratch: + docker push $(IMAGE_SCRATCH) + SENTRY_IMAGE=getsentry/sentry-cli:2.16.1 sentry_prefetch: docker pull $(SENTRY_IMAGE) diff --git a/services/web/cypress.config.ts b/services/web/cypress.config.ts index 16dcb192a3..d88b48d7f6 100644 --- a/services/web/cypress.config.ts +++ b/services/web/cypress.config.ts @@ -14,6 +14,7 @@ if (process.env.CI) { export default defineConfig({ fixturesFolder: 'cypress/fixtures', video: process.env.CYPRESS_VIDEO === 'true', + downloadsFolder: process.env.CYPRESS_DOWNLOADS || 'cypress/downloads', screenshotsFolder: process.env.CYPRESS_RESULTS || 'cypress/results', videosFolder: process.env.CYPRESS_RESULTS || 'cypress/results', viewportHeight: 800, diff --git a/services/web/docker-compose.ci.yml b/services/web/docker-compose.ci.yml index 54530b5707..a7976b2fd4 100644 --- a/services/web/docker-compose.ci.yml +++ b/services/web/docker-compose.ci.yml @@ -89,6 +89,7 @@ services: user: "${DOCKER_USER:-1000:1000}" environment: CI: + CYPRESS_DOWNLOADS: CYPRESS_RESULTS: CYPRESS_SPEC_PATTERN: CYPRESS_EXCLUDE_SPEC_PATTERN: