diff --git a/services/web/Makefile b/services/web/Makefile index 051b7f9e9d..a3a44f122b 100644 --- a/services/web/Makefile +++ b/services/web/Makefile @@ -235,6 +235,14 @@ TEST_ACCEPTANCE_APP := \ test_acceptance_app_server_ce \ test_acceptance_app_server_pro \ +ifeq ($(DEBUG),true) +TEST_ACCEPTANCE_DEBUG_PORT := -p 127.0.0.1:19999:19999 +TEST_ACCEPTANCE_NPM_SCRIPT := npm run --silent test:acceptance:app:debug +else +TEST_ACCEPTANCE_DEBUG_PORT := +TEST_ACCEPTANCE_NPM_SCRIPT := npm run --silent test:acceptance:app +endif + test_acceptance_app: $(TEST_ACCEPTANCE_APP) test_acceptance_app_saas: export JUNIT_ROOT_SUITE_NAME = SaaS app acceptance tests test_acceptance_app_saas: export COMPOSE_PROJECT_NAME=acceptance_test_saas_$(BUILD_DIR_NAME) @@ -247,7 +255,7 @@ test_acceptance_app_server_pro: export COMPOSE_PROJECT_NAME=acceptance_test_serv test_acceptance_app_server_pro: export OVERLEAF_CONFIG=$(CFG_SERVER_PRO) $(TEST_ACCEPTANCE_APP): - $(DOCKER_COMPOSE) run --rm test_acceptance + $(DOCKER_COMPOSE) run --rm $(TEST_ACCEPTANCE_DEBUG_PORT) test_acceptance $(TEST_ACCEPTANCE_NPM_SCRIPT) $(DOCKER_COMPOSE) down -v -t 0 # We are using _make magic_ for turning these file-targets into calls to diff --git a/services/web/Makefile.module b/services/web/Makefile.module index ea169a92d0..580e726088 100644 --- a/services/web/Makefile.module +++ b/services/web/Makefile.module @@ -46,6 +46,14 @@ $(ALL_TEST_ACCEPTANCE_VARIANTS) test_acceptance_merged_inner: clean_test_acceptance: else +ifeq ($(DEBUG),true) +TEST_ACCEPTANCE_DEBUG_PORT := -p 127.0.0.1:19999:19999 +TEST_ACCEPTANCE_NPM_SCRIPT := test:acceptance:debug:run_dir +else +TEST_ACCEPTANCE_DEBUG_PORT := +TEST_ACCEPTANCE_NPM_SCRIPT := test:acceptance:run_dir +endif + test_acceptance_saas: export BASE_CONFIG = $(CFG_SAAS) test_acceptance_server_ce: export BASE_CONFIG = $(CFG_SERVER_CE) test_acceptance_server_pro: export BASE_CONFIG = $(CFG_SERVER_PRO) @@ -53,7 +61,7 @@ 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 npm -q run test:acceptance:run_dir -- ${MOCHA_ARGS} $(MODULE_DIR)/test/acceptance/src + ${DOCKER_COMPOSE} run --rm $(TEST_ACCEPTANCE_DEBUG_PORT) test_acceptance npm -q run $(TEST_ACCEPTANCE_NPM_SCRIPT) -- ${MOCHA_ARGS} $(MODULE_DIR)/test/acceptance/src $(MAKE) --no-print-directory clean_test_acceptance test_acceptance_merged_inner: diff --git a/services/web/package.json b/services/web/package.json index aa4415abeb..43135738b8 100644 --- a/services/web/package.json +++ b/services/web/package.json @@ -9,6 +9,8 @@ "scripts": { "test:acceptance:run_dir": "bin/test_acceptance_run_dir", "test:acceptance:app": "npm run test:acceptance:run_dir -- test/acceptance/src", + "test:acceptance:app:debug": "npm run test:acceptance:debug:run_dir -- test/acceptance/src", + "test:acceptance:debug:run_dir": "mocha --recursive --timeout 25000 --grep=$MOCHA_GREP --require test/acceptance/bootstrap.js --inspect=0.0.0.0:19999 --inspect-brk", "test:unit:run_dir": "bin/test_unit_run_dir", "test:unit:all": "npm run test:unit:run_dir -- test/unit/src modules/*/test/unit/src", "test:unit:all:silent": "npm run test:unit:all -- --reporter dot",