[monorepo] fix running tests locally (#33186)

* [monorepo] fix running tests locally

* [web] fix east invocation

* [web] move corepack into entrypoint

* [web] fix running module acceptance tests locally

* [web] fix merged module targets

* [web] remove spurious change

GitOrigin-RevId: 84cf7f8d768d3429c8a98c789acf76f6cecd6e3e
This commit is contained in:
Jakob Ackermann
2026-04-28 14:22:33 +02:00
committed by Copybot
parent 396e158ecd
commit da11cf2669
20 changed files with 60 additions and 22 deletions

View File

@@ -12,6 +12,7 @@ services:
- ../../package.json:/overleaf/package.json
- ../../.yarnrc.yml:/overleaf/.yarnrc.yml
- ../../yarn.lock:/overleaf/yarn.lock
- ../../.yarn:/overleaf/.yarn
- ../../bin/shared/wait_for_it:/overleaf/bin/shared/wait_for_it
- ../../tools/migrations:/overleaf/tools/migrations
working_dir: /overleaf/services/chat
@@ -37,6 +38,7 @@ services:
- ../../package.json:/overleaf/package.json
- ../../.yarnrc.yml:/overleaf/.yarnrc.yml
- ../../yarn.lock:/overleaf/yarn.lock
- ../../.yarn:/overleaf/.yarn
- ../../bin/shared/wait_for_it:/overleaf/bin/shared/wait_for_it
- ../../tools/migrations:/overleaf/tools/migrations
working_dir: /overleaf/services/chat

View File

@@ -15,6 +15,7 @@ services:
- ../../package.json:/overleaf/package.json
- ../../.yarnrc.yml:/overleaf/.yarnrc.yml
- ../../yarn.lock:/overleaf/yarn.lock
- ../../.yarn:/overleaf/.yarn
- ../../tsconfig.backend.json:/overleaf/tsconfig.backend.json
working_dir: /overleaf/services/clsi
environment:
@@ -37,6 +38,7 @@ services:
- ../../package.json:/overleaf/package.json
- ../../.yarnrc.yml:/overleaf/.yarnrc.yml
- ../../yarn.lock:/overleaf/yarn.lock
- ../../.yarn:/overleaf/.yarn
- /var/run/docker.sock:/var/run/docker.sock
working_dir: /overleaf/services/clsi
environment:

View File

@@ -12,6 +12,7 @@ services:
- ../../package.json:/overleaf/package.json
- ../../.yarnrc.yml:/overleaf/.yarnrc.yml
- ../../yarn.lock:/overleaf/yarn.lock
- ../../.yarn:/overleaf/.yarn
- ../../bin/shared/wait_for_it:/overleaf/bin/shared/wait_for_it
- ../../tools/migrations:/overleaf/tools/migrations
working_dir: /overleaf/services/contacts
@@ -37,6 +38,7 @@ services:
- ../../package.json:/overleaf/package.json
- ../../.yarnrc.yml:/overleaf/.yarnrc.yml
- ../../yarn.lock:/overleaf/yarn.lock
- ../../.yarn:/overleaf/.yarn
- ../../bin/shared/wait_for_it:/overleaf/bin/shared/wait_for_it
- ../../tools/migrations:/overleaf/tools/migrations
working_dir: /overleaf/services/contacts

View File

@@ -12,6 +12,7 @@ services:
- ../../package.json:/overleaf/package.json
- ../../.yarnrc.yml:/overleaf/.yarnrc.yml
- ../../yarn.lock:/overleaf/yarn.lock
- ../../.yarn:/overleaf/.yarn
- ../../bin/shared/wait_for_it:/overleaf/bin/shared/wait_for_it
- ../../tools/migrations:/overleaf/tools/migrations
- ../../tsconfig.backend.json:/overleaf/tsconfig.backend.json
@@ -38,6 +39,7 @@ services:
- ../../package.json:/overleaf/package.json
- ../../.yarnrc.yml:/overleaf/.yarnrc.yml
- ../../yarn.lock:/overleaf/yarn.lock
- ../../.yarn:/overleaf/.yarn
- ../../bin/shared/wait_for_it:/overleaf/bin/shared/wait_for_it
- ../../tools/migrations:/overleaf/tools/migrations
working_dir: /overleaf/services/docstore

View File

@@ -12,6 +12,7 @@ services:
- ../../package.json:/overleaf/package.json
- ../../.yarnrc.yml:/overleaf/.yarnrc.yml
- ../../yarn.lock:/overleaf/yarn.lock
- ../../.yarn:/overleaf/.yarn
- ../../bin/shared/wait_for_it:/overleaf/bin/shared/wait_for_it
- ../../tools/migrations:/overleaf/tools/migrations
working_dir: /overleaf/services/document-updater
@@ -44,6 +45,7 @@ services:
- ../../package.json:/overleaf/package.json
- ../../.yarnrc.yml:/overleaf/.yarnrc.yml
- ../../yarn.lock:/overleaf/yarn.lock
- ../../.yarn:/overleaf/.yarn
- ../../bin/shared/wait_for_it:/overleaf/bin/shared/wait_for_it
- ../../tools/migrations:/overleaf/tools/migrations
working_dir: /overleaf/services/document-updater

View File

@@ -18,6 +18,7 @@ services:
- ../../package.json:/overleaf/package.json
- ../../.yarnrc.yml:/overleaf/.yarnrc.yml
- ../../yarn.lock:/overleaf/yarn.lock
- ../../.yarn:/overleaf/.yarn
- ../../tsconfig.backend.json:/overleaf/tsconfig.backend.json
working_dir: /overleaf/services/filestore
environment:
@@ -41,6 +42,7 @@ services:
- ../../package.json:/overleaf/package.json
- ../../.yarnrc.yml:/overleaf/.yarnrc.yml
- ../../yarn.lock:/overleaf/yarn.lock
- ../../.yarn:/overleaf/.yarn
- minio-certs:/certs
working_dir: /overleaf/services/filestore
environment:

View File

@@ -18,6 +18,7 @@ services:
- ../../package.json:/overleaf/package.json
- ../../.yarnrc.yml:/overleaf/.yarnrc.yml
- ../../yarn.lock:/overleaf/yarn.lock
- ../../.yarn:/overleaf/.yarn
- ../../bin/shared/wait_for_it:/overleaf/bin/shared/wait_for_it
- ../../tools/migrations:/overleaf/tools/migrations
working_dir: /overleaf/services/history-v1
@@ -53,6 +54,7 @@ services:
- ../../package.json:/overleaf/package.json
- ../../.yarnrc.yml:/overleaf/.yarnrc.yml
- ../../yarn.lock:/overleaf/yarn.lock
- ../../.yarn:/overleaf/.yarn
- minio-certs:/certs
- ../../bin/shared/wait_for_it:/overleaf/bin/shared/wait_for_it
- ../../tools/migrations:/overleaf/tools/migrations

View File

@@ -12,6 +12,7 @@ services:
- ../../package.json:/overleaf/package.json
- ../../.yarnrc.yml:/overleaf/.yarnrc.yml
- ../../yarn.lock:/overleaf/yarn.lock
- ../../.yarn:/overleaf/.yarn
- ../../bin/shared/wait_for_it:/overleaf/bin/shared/wait_for_it
- ../../tools/migrations:/overleaf/tools/migrations
- ../../tsconfig.backend.json:/overleaf/tsconfig.backend.json
@@ -38,6 +39,7 @@ services:
- ../../package.json:/overleaf/package.json
- ../../.yarnrc.yml:/overleaf/.yarnrc.yml
- ../../yarn.lock:/overleaf/yarn.lock
- ../../.yarn:/overleaf/.yarn
- ../../bin/shared/wait_for_it:/overleaf/bin/shared/wait_for_it
- ../../tools/migrations:/overleaf/tools/migrations
- ../../tsconfig.backend.json:/overleaf/tsconfig.backend.json

View File

@@ -12,6 +12,7 @@ services:
- ../../package.json:/overleaf/package.json
- ../../.yarnrc.yml:/overleaf/.yarnrc.yml
- ../../yarn.lock:/overleaf/yarn.lock
- ../../.yarn:/overleaf/.yarn
- ../../bin/shared/wait_for_it:/overleaf/bin/shared/wait_for_it
- ../../tools/migrations:/overleaf/tools/migrations
working_dir: /overleaf/services/project-history
@@ -44,6 +45,7 @@ services:
- ../../package.json:/overleaf/package.json
- ../../.yarnrc.yml:/overleaf/.yarnrc.yml
- ../../yarn.lock:/overleaf/yarn.lock
- ../../.yarn:/overleaf/.yarn
- ../../bin/shared/wait_for_it:/overleaf/bin/shared/wait_for_it
- ../../tools/migrations:/overleaf/tools/migrations
working_dir: /overleaf/services/project-history

View File

@@ -12,6 +12,7 @@ services:
- ../../package.json:/overleaf/package.json
- ../../.yarnrc.yml:/overleaf/.yarnrc.yml
- ../../yarn.lock:/overleaf/yarn.lock
- ../../.yarn:/overleaf/.yarn
- ../../tsconfig.backend.json:/overleaf/tsconfig.backend.json
working_dir: /overleaf/services/real-time
environment:
@@ -40,6 +41,7 @@ services:
- ../../package.json:/overleaf/package.json
- ../../.yarnrc.yml:/overleaf/.yarnrc.yml
- ../../yarn.lock:/overleaf/yarn.lock
- ../../.yarn:/overleaf/.yarn
working_dir: /overleaf/services/real-time
environment:
RETRIES:

View File

@@ -342,7 +342,7 @@ $(TEST_ACCEPTANCE_MODULE_MAYBE_IN): test_acceptance_module_maybe_in_%:
$(MAKE) $(shell \
OVERLEAF_CONFIG=$(BASE_CONFIG) \
$(DOCKER_COMPOSE) run --rm test_unit \
node test/acceptance/getModuleTargets test_acceptance_$* \
yarn node test/acceptance/getModuleTargets test_acceptance_$* \
| grep -e /$(MODULE_NAME)/ || echo test_acceptance_module_noop LABEL=$* \
)
@@ -365,7 +365,7 @@ $(TEST_ACCEPTANCE_MODULES_MERGED_INNER): %/test_acceptance_merged_inner: %/Makef
test_acceptance_modules_merged_inner:
$(MAKE) $(shell \
OVERLEAF_CONFIG=$(BASE_CONFIG) \
node test/acceptance/getModuleTargets test_acceptance_merged_inner \
yarn node test/acceptance/getModuleTargets test_acceptance_merged_inner \
)
# inner loop for running saas tests in parallel
@@ -388,7 +388,7 @@ TEST_ACCEPTANCE_MODULES_MERGED_INNER_SPLIT = \
$(TEST_ACCEPTANCE_MODULES_MERGED_INNER_SPLIT):
$(MAKE) $(shell \
OVERLEAF_CONFIG=$(BASE_CONFIG) \
node test/acceptance/getModuleTargets test_acceptance_merged_inner \
yarn node test/acceptance/getModuleTargets test_acceptance_merged_inner \
| tail -n+$(START) | head -n 10 \
| grep -e . || echo no_more_targets \
)
@@ -417,7 +417,7 @@ TEST_ACCEPTANCE_MODULES_MERGED_VARIANTS = \
test_acceptance_modules_merged_server_pro \
$(TEST_ACCEPTANCE_MODULES_MERGED_VARIANTS):
$(DOCKER_COMPOSE) run --rm test_acceptance make test_acceptance_modules_merged_inner
$(DOCKER_COMPOSE) run --rm test_acceptance yarn exec make test_acceptance_modules_merged_inner
$(DOCKER_COMPOSE) down -v -t 0
# outer loop for running saas tests in parallel
@@ -439,7 +439,7 @@ $(TEST_ACCEPTANCE_MODULES_MERGED_SPLIT_SAAS): export BASE_CONFIG = $(CFG_SAAS)
$(TEST_ACCEPTANCE_MODULES_MERGED_SPLIT_SAAS): export JUNIT_ROOT_SUITE_NAME = SaaS modules acceptance tests
$(TEST_ACCEPTANCE_MODULES_MERGED_SPLIT_SAAS): test_acceptance_modules_merged_saas_%:
$(DOCKER_COMPOSE) run --rm test_acceptance make test_acceptance_modules_merged_inner_$*
$(DOCKER_COMPOSE) run --rm test_acceptance yarn exec make test_acceptance_modules_merged_inner_$*
$(DOCKER_COMPOSE) down -v -t 0
test_acceptance_modules: $(TEST_ACCEPTANCE_MODULES_MERGED_VARIANTS)
@@ -465,7 +465,7 @@ ci:
# Run the linting commands in the scope of the monorepo.
# Eslint and prettier (plus some configs) are on the root.
RUN_LINTING_CI_MONOREPO = docker run --rm --volume $(MONOREPO)/.editorconfig:/overleaf/.editorconfig --volume $(MONOREPO)/.eslintignore:/overleaf/.eslintignore --volume $(MONOREPO)/.eslintrc:/overleaf/.eslintrc --volume $(MONOREPO)/.prettierignore:/overleaf/.prettierignore --volume $(MONOREPO)/.prettierrc:/overleaf/.prettierrc --volume $(MONOREPO)/tsconfig.backend.json:/overleaf/tsconfig.backend.json --volume $(MONOREPO)/services/web/data/reports:/overleaf/services/web/data/reports --volume $(MONOREPO)/node_modules/.cache/:/overleaf/node_modules/.cache/ -w /overleaf $(IMAGE_CI) corepack yarn run --silent
RUN_LINTING_CI_MONOREPO = docker run --rm --volume $(MONOREPO)/.editorconfig:/overleaf/.editorconfig --volume $(MONOREPO)/.eslintignore:/overleaf/.eslintignore --volume $(MONOREPO)/.eslintrc:/overleaf/.eslintrc --volume $(MONOREPO)/.prettierignore:/overleaf/.prettierignore --volume $(MONOREPO)/.prettierrc:/overleaf/.prettierrc --volume $(MONOREPO)/tsconfig.backend.json:/overleaf/tsconfig.backend.json --volume $(MONOREPO)/services/web/data/reports:/overleaf/services/web/data/reports --volume $(MONOREPO)/node_modules/.cache/:/overleaf/node_modules/.cache/ -w /overleaf $(IMAGE_CI) yarn run --silent
RUN_LINTING_MONOREPO = docker run --rm -v $(MONOREPO):$(MONOREPO) -w $(MONOREPO) --user node node:24.14.1 corepack yarn run --silent
ORG_PATH = /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin

View File

@@ -26,7 +26,7 @@ test_unit:
else
test_unit: export COMPOSE_PROJECT_NAME=unit_test_$(BUILD_DIR_NAME)_$(MODULE_NAME)
test_unit:
${DOCKER_COMPOSE} run --rm test_unit npm -q run test:unit:run_dir -- ${MOCHA_ARGS} $(MODULE_DIR)/test/unit/src
${DOCKER_COMPOSE} run --rm test_unit yarn test:unit:run_dir -- ${MOCHA_ARGS} $(MODULE_DIR)/test/unit/src
${DOCKER_COMPOSE} down
endif
@@ -61,12 +61,12 @@ test_acceptance_server_pro: export BASE_CONFIG = $(CFG_SERVER_PRO)
$(ALL_TEST_ACCEPTANCE_VARIANTS): export COMPOSE_PROJECT_NAME=acceptance_test_$(BUILD_DIR_NAME)_$(MODULE_NAME)
$(ALL_TEST_ACCEPTANCE_VARIANTS):
$(MAKE) --no-print-directory clean_test_acceptance
${DOCKER_COMPOSE} run --rm $(TEST_ACCEPTANCE_DEBUG_PORT) test_acceptance npm -q run $(TEST_ACCEPTANCE_NPM_SCRIPT) -- ${MOCHA_ARGS} $(MODULE_DIR)/test/acceptance/src
${DOCKER_COMPOSE} run --rm $(TEST_ACCEPTANCE_DEBUG_PORT) test_acceptance yarn $(TEST_ACCEPTANCE_NPM_SCRIPT) -- ${MOCHA_ARGS} $(MODULE_DIR)/test/acceptance/src
$(MAKE) --no-print-directory clean_test_acceptance
test_acceptance_merged_inner:
cd ../../ && \
npm -q run test:acceptance:run_dir -- ${MOCHA_ARGS} $(MODULE_DIR)/test/acceptance/src
yarn test:acceptance:run_dir -- ${MOCHA_ARGS} $(MODULE_DIR)/test/acceptance/src
clean_test_acceptance: export COMPOSE_PROJECT_NAME=acceptance_test_$(BUILD_DIR_NAME)_$(MODULE_NAME)
clean_test_acceptance:

View File

@@ -10,6 +10,10 @@ services:
- ../../libraries:/overleaf/libraries
- ../../bin/shared/wait_for_it:/overleaf/bin/shared/wait_for_it
- ../../tools/migrations:/overleaf/tools/migrations
- ../../package.json:/overleaf/package.json
- ../../.yarnrc.yml:/overleaf/.yarnrc.yml
- ../../yarn.lock:/overleaf/yarn.lock
- ../../.yarn:/overleaf/.yarn
working_dir: /overleaf/services/web
env_file: docker-compose.common.env
environment:
@@ -25,8 +29,8 @@ services:
NODE_OPTIONS: "--unhandled-rejections=strict"
REDIS_HOST: redis_test
MONOREPO:
entrypoint: /overleaf/bin/shared/wait_for_it mongo:27017 --timeout=60 --
command: corepack yarn run --silent test:unit:app
entrypoint: /overleaf/bin/shared/wait_for_it mongo:27017 --timeout=60 -- corepack
command: yarn run --silent test:unit:app
user: node
depends_on:
- mongo
@@ -40,6 +44,10 @@ services:
- ../../libraries:/overleaf/libraries
- ../../bin/shared/wait_for_it:/overleaf/bin/shared/wait_for_it
- ../../tools/migrations:/overleaf/tools/migrations
- ../../package.json:/overleaf/package.json
- ../../.yarnrc.yml:/overleaf/.yarnrc.yml
- ../../yarn.lock:/overleaf/yarn.lock
- ../../.yarn:/overleaf/.yarn
user: node
working_dir: /overleaf/services/web
env_file: docker-compose.common.env
@@ -66,8 +74,8 @@ services:
- mongo
- saml
- ldap
entrypoint: /overleaf/bin/shared/wait_for_it mongo:27017 --timeout=60 --
command: corepack yarn run --silent test:acceptance:app
entrypoint: /overleaf/bin/shared/wait_for_it mongo:27017 --timeout=60 -- corepack
command: yarn run --silent test:acceptance:app
test_frontend_jsdom:
build:
@@ -78,6 +86,10 @@ services:
- .:/overleaf/services/web
- ../../node_modules:/overleaf/node_modules
- ../../libraries:/overleaf/libraries
- ../../package.json:/overleaf/package.json
- ../../.yarnrc.yml:/overleaf/.yarnrc.yml
- ../../yarn.lock:/overleaf/yarn.lock
- ../../.yarn:/overleaf/.yarn
working_dir: /overleaf/services/web
environment:
CI:
@@ -85,7 +97,8 @@ services:
MOCHA_GREP: ${MOCHA_GREP}
NODE_OPTIONS: "--unhandled-rejections=strict"
VERBOSE_LOGGING:
command: corepack yarn run --silent test:frontend
entrypoint: corepack
command: yarn run --silent test:frontend
user: node
test_frontend_ct:
@@ -117,13 +130,18 @@ services:
- .:/overleaf/services/web
- ../../node_modules:/overleaf/node_modules
- ../../libraries:/overleaf/libraries
- ../../package.json:/overleaf/package.json
- ../../.yarnrc.yml:/overleaf/.yarnrc.yml
- ../../yarn.lock:/overleaf/yarn.lock
- ../../.yarn:/overleaf/.yarn
working_dir: /overleaf/services/web
environment:
CI:
JUNIT_ROOT_SUITE_NAME:
NODE_OPTIONS: "--unhandled-rejections=strict"
VERBOSE_LOGGING:
command: corepack yarn run --silent test:writefull
entrypoint: corepack
command: yarn run --silent test:writefull
user: node
redis_test:

View File

@@ -67,7 +67,7 @@ describe('BackFillDocNameForDeletedDocs', function () {
let result
try {
result = await promisify(exec)(
'cd ../../tools/migrations && east migrate -t saas --force 20210727150530_ce_sp_backfill_deleted_docs'
'cd ../../tools/migrations && yarn run migrations migrate -t saas --force 20210727150530_ce_sp_backfill_deleted_docs'
)
} catch (error) {
// dump details like exit code, stdErr and stdOut

View File

@@ -21,7 +21,7 @@ describe('BackFillDocRevTests', function () {
let result
try {
result = await promisify(exec)(
'cd ../../tools/migrations && VERBOSE_LOGGING=true east migrate -t server-ce --force 20230315170739_back_fill_doc_rev'
'cd ../../tools/migrations && VERBOSE_LOGGING=true yarn run migrations migrate -t server-ce --force 20230315170739_back_fill_doc_rev'
)
} catch (error) {
// dump details like exit code, stdErr and stdOut

View File

@@ -109,7 +109,7 @@ describe('BackFillDummyDocMeta', function () {
let result
try {
result = await promisify(exec)(
'cd ../../tools/migrations && east migrate -t saas --force 20210728115327_ce_sp_backfill_dummy_doc_meta'
'cd ../../tools/migrations && yarn run migrations migrate -t saas --force 20210728115327_ce_sp_backfill_dummy_doc_meta'
)
} catch (error) {
// dump details like exit code, stdErr and stdOut

View File

@@ -120,7 +120,7 @@ describe('ConvertArchivedState', function () {
beforeEach(function (done) {
exec(
'cd ../../tools/migrations && east migrate --tag server-ce --force 20221111111111_ce_sp_convert_archived_state',
'cd ../../tools/migrations && yarn run migrations migrate --tag server-ce --force 20221111111111_ce_sp_convert_archived_state',
error => {
if (error) {
return done(error)

View File

@@ -28,7 +28,7 @@ describe('ConvertEmailConfirmedAtToDates', function () {
beforeEach('run migration', function (done) {
exec(
'cd ../../tools/migrations && east migrate -t saas --force 20210726083523_convert_confirmedAt_strings_to_dates',
'cd ../../tools/migrations && yarn run migrations migrate -t saas --force 20210726083523_convert_confirmedAt_strings_to_dates',
done
)
})

View File

@@ -65,7 +65,7 @@ describe('ConvertSplitTestAssignedAtToDates', function () {
beforeEach('run migration', function (done) {
exec(
'cd ../../tools/migrations && east migrate -t saas --force 20210726083523_convert_split_tests_assigned_at_strings_to_dates',
'cd ../../tools/migrations && yarn run migrations migrate -t saas --force 20210726083523_convert_split_tests_assigned_at_strings_to_dates',
done
)
})

View File

@@ -50,7 +50,7 @@ describe('RemoveDeletedUsersFromTokenAccessRefsTests', function () {
let result
try {
result = await promisify(exec)(
'cd ../../tools/migrations && east migrate -t saas --force 20240220130452_remove_deleted_users_from_token_access_refs'
'cd ../../tools/migrations && yarn run migrations migrate -t saas --force 20240220130452_remove_deleted_users_from_token_access_refs'
)
} catch (error) {
// dump details like exit code, stdErr and stdOut