2020-01-23 07:46:07 -06:00
|
|
|
if ENABLE_CYPRESS
|
2020-02-13 05:57:37 -06:00
|
|
|
|
2020-05-12 14:29:08 -05:00
|
|
|
export NODE_PATH=$(abs_builddir)/node_modules
|
|
|
|
|
2020-02-13 05:57:37 -06:00
|
|
|
abs_dir = $(if $(filter $(abs_builddir),$(abs_srcdir)),.,$(abs_srcdir))
|
2020-02-21 12:53:52 -06:00
|
|
|
CYPRESS_BINARY = $(abs_builddir)/node_modules/cypress/bin/cypress
|
|
|
|
ESLINT_BINARY = $(abs_builddir)/node_modules/eslint/bin/eslint.js
|
|
|
|
WAIT_ON_BINARY = $(abs_builddir)/node_modules/wait-on/bin/wait-on
|
|
|
|
GET_PORT_BINARY = $(abs_builddir)/node_modules/get-port-cli/cli.js
|
2020-02-23 04:46:17 -06:00
|
|
|
NPM_INSTALLED = $(abs_builddir)/workdir/npm_installed
|
2020-02-21 11:27:15 -06:00
|
|
|
|
2020-07-23 06:23:14 -05:00
|
|
|
PARALLEL_SCRIPT = $(abs_srcdir)/run_parallel.sh
|
|
|
|
|
2020-02-23 05:08:36 -06:00
|
|
|
PID_FILE=$(abs_builddir)/workdir/loolwsd.pid
|
2020-03-02 10:15:38 -06:00
|
|
|
ERROR_LOG=$(abs_builddir)/workdir/error.log
|
2020-01-10 09:38:37 -06:00
|
|
|
|
2020-06-24 05:50:29 -05:00
|
|
|
SUPPORT_FILE_ABS = $(abs_srcdir)/support/index.js
|
|
|
|
SUPPORT_FILE = $(if $(findstring $(abs_srcdir),$(abs_builddir)),support/index.js,$(SUPPORT_FILE_ABS))
|
2020-05-18 08:36:26 -05:00
|
|
|
|
2020-01-28 09:19:26 -06:00
|
|
|
DESKTOP_USER_AGENT = "cypress"
|
2020-02-21 12:53:52 -06:00
|
|
|
DESKTOP_TEST_FOLDER = $(abs_srcdir)/integration_tests/desktop
|
|
|
|
DESKTOP_DATA_FOLDER = $(abs_srcdir)/data/desktop/
|
|
|
|
DESKTOP_WORKDIR = $(abs_builddir)/workdir/desktop/
|
2020-02-20 15:01:27 -06:00
|
|
|
DESKTOP_TRACK_FOLDER=$(abs_builddir)/workdir/track/desktop
|
2020-01-15 07:55:03 -06:00
|
|
|
|
2020-03-12 09:55:56 -05:00
|
|
|
MOBILE_USER_AGENT = "cypress-mobile"
|
2020-02-21 12:53:52 -06:00
|
|
|
MOBILE_TEST_FOLDER = $(abs_srcdir)/integration_tests/mobile
|
|
|
|
MOBILE_DATA_FOLDER = $(abs_srcdir)/data/mobile/
|
|
|
|
MOBILE_WORKDIR = $(abs_builddir)/workdir/mobile/
|
2020-02-20 15:01:27 -06:00
|
|
|
MOBILE_TRACK_FOLDER=$(abs_builddir)/workdir/track/mobile
|
2020-01-10 09:38:37 -06:00
|
|
|
|
2020-07-17 07:03:33 -05:00
|
|
|
MULTIUSER_TEST_FOLDER = $(abs_srcdir)/integration_tests/multiuser
|
|
|
|
MULTIUSER_DATA_FOLDER = $(abs_srcdir)/data/multiuser/
|
|
|
|
MULTIUSER_WORKDIR = $(abs_builddir)/workdir/multiuser/
|
|
|
|
MULTIUSER_TRACK_FOLDER=$(abs_builddir)/workdir/track/multiuser
|
|
|
|
|
2020-02-19 21:15:58 -06:00
|
|
|
ALLOWED_PORTS = $(shell seq 9900 1 9980)
|
2020-02-20 03:03:42 -06:00
|
|
|
KILL_COMMAND=pkill -F $(PID_FILE) || pkill --signal SIGKILL -F $(PID_FILE)
|
2020-03-14 14:42:48 -05:00
|
|
|
PARALLEL_BUILD = $(findstring -j,$(MAKEFLAGS))
|
2020-02-25 06:09:31 -06:00
|
|
|
DISPLAY_NUMBER = 100
|
|
|
|
HEADLESS_BUILD := $(findstring Command failed,$(shell xhost > /dev/null 2>&1 || echo "Command failed, so we are in a headless environment."))
|
|
|
|
export DISPLAY=$(if $(HEADLESS_BUILD),:$(DISPLAY_NUMBER),$(shell echo $$DISPLAY))
|
2020-02-20 03:03:42 -06:00
|
|
|
|
2020-06-24 05:50:29 -05:00
|
|
|
COMMA :=,
|
2020-07-24 07:56:55 -05:00
|
|
|
EMPTY :=
|
|
|
|
SPACE :=$(EMPTY) $(EMPTY)
|
|
|
|
|
|
|
|
CORE_VERSION := $(subst $(SPACE),_,$(shell "@LO_PATH@"/program/soffice.bin --version 2> /dev/null))
|
2020-06-24 05:50:29 -05:00
|
|
|
|
2020-08-31 09:16:31 -05:00
|
|
|
BROWSER:=$(if $(CYPRESS_BROWSER),$(CYPRESS_BROWSER),$(CHROME))
|
2020-08-10 09:24:30 -05:00
|
|
|
|
2020-05-18 15:23:50 -05:00
|
|
|
if ENABLE_DEBUG
|
|
|
|
FILTER_DEBUG=cypress:electron,cypress:launcher
|
|
|
|
export DEBUG=$(if $(ENABLE_LOGGING),$(FILTER_DEBUG),)
|
|
|
|
endif
|
|
|
|
|
2020-01-12 06:05:04 -06:00
|
|
|
if HAVE_LO_PATH
|
2020-02-20 15:01:27 -06:00
|
|
|
|
2020-04-14 05:29:30 -05:00
|
|
|
MOBILE_TEST_FILES=$(subst $(MOBILE_TEST_FOLDER)/,,$(wildcard $(MOBILE_TEST_FOLDER)/*_spec.js) $(wildcard $(MOBILE_TEST_FOLDER)/*/*_spec.js))
|
|
|
|
|
2020-10-03 10:39:30 -05:00
|
|
|
DESKTOP_TEST_FILES=$(subst $(DESKTOP_TEST_FOLDER)/,,$(wildcard $(DESKTOP_TEST_FOLDER)/*_spec.js) $(wildcard $(DESKTOP_TEST_FOLDER)/*/*_spec.js))
|
2020-02-20 15:01:27 -06:00
|
|
|
|
2020-07-29 05:06:10 -05:00
|
|
|
MULTIUSER_TESTS= \
|
2020-08-07 07:59:09 -05:00
|
|
|
writer/paragraph_prop \
|
|
|
|
writer/sidebar_visibility \
|
|
|
|
writer/simultaneous_typing \
|
|
|
|
calc/sheet_operations \
|
2020-12-01 03:36:52 -06:00
|
|
|
impress/slide_operations
|
2020-07-17 07:03:33 -05:00
|
|
|
|
2020-02-20 15:01:27 -06:00
|
|
|
MOBILE_TEST_FILES_DONE= \
|
|
|
|
$(foreach test_file,$(MOBILE_TEST_FILES),$(MOBILE_TRACK_FOLDER)/$(test_file).done)
|
|
|
|
|
|
|
|
DESKTOP_TEST_FILES_DONE= \
|
2020-10-03 10:39:30 -05:00
|
|
|
$(foreach test_file,$(DESKTOP_TEST_FILES),$(DESKTOP_TRACK_FOLDER)/$(test_file).done)
|
2020-02-20 15:01:27 -06:00
|
|
|
|
2020-07-29 05:06:10 -05:00
|
|
|
MULTIUSER_TESTS_DONE= \
|
2020-11-19 02:42:44 -06:00
|
|
|
$(MULTIUSER_TRACK_FOLDER)/multiuser_tests.done
|
2020-07-17 07:03:33 -05:00
|
|
|
|
2020-03-02 10:15:38 -06:00
|
|
|
check-local: do-check
|
2020-03-11 19:42:06 -05:00
|
|
|
$(if $(wildcard $(ERROR_LOG)),$(error CypressError: some tests failed!))
|
2020-03-02 10:15:38 -06:00
|
|
|
|
2020-07-29 05:06:10 -05:00
|
|
|
do-check: $(DESKTOP_TEST_FILES_DONE) $(MOBILE_TEST_FILES_DONE) $(MULTIUSER_TESTS_DONE)
|
2020-02-20 15:01:27 -06:00
|
|
|
@$(KILL_COMMAND) || true
|
2020-02-25 06:09:31 -06:00
|
|
|
$(if $(HEADLESS_BUILD),@pkill Xvfb,)
|
2020-03-02 10:15:38 -06:00
|
|
|
$(if $(wildcard $(ERROR_LOG)),@cat $(ERROR_LOG))
|
2020-02-20 15:01:27 -06:00
|
|
|
|
|
|
|
$(PID_FILE): @JAILS_PATH@ $(NODE_BINS)
|
2020-03-02 10:15:38 -06:00
|
|
|
@rm -f $(ERROR_LOG)
|
2020-01-30 08:17:29 -06:00
|
|
|
$(call run_JS_error_check)
|
2020-02-25 06:09:31 -06:00
|
|
|
$(if $(HEADLESS_BUILD),$(call start_Xvfb),)
|
2020-01-14 12:37:17 -06:00
|
|
|
$(call start_loolwsd)
|
2020-02-20 15:01:27 -06:00
|
|
|
|
2020-04-30 10:42:38 -05:00
|
|
|
$(MOBILE_TEST_FILES_DONE): $(PID_FILE) $(DESKTOP_TEST_FILES_DONE)
|
2020-02-28 07:37:56 -06:00
|
|
|
$(if $(PARALLEL_BUILD),\
|
2020-03-02 10:15:38 -06:00
|
|
|
$(call run_mobile_tests,$(subst $(MOBILE_TRACK_FOLDER)/,,$(basename $@)),$(basename $@).log),\
|
2020-02-28 07:37:56 -06:00
|
|
|
$(call run_mobile_tests))
|
|
|
|
$(if $(PARALLEL_BUILD),\
|
|
|
|
@mkdir -p $(dir $@) && touch $@\
|
|
|
|
,\
|
|
|
|
@$(foreach done_file,$(MOBILE_TEST_FILES_DONE),mkdir -p $(dir $(done_file)) && touch $(done_file) &&) true\
|
|
|
|
)
|
2020-02-20 15:01:27 -06:00
|
|
|
|
|
|
|
$(DESKTOP_TEST_FILES_DONE): $(PID_FILE)
|
2020-02-28 07:37:56 -06:00
|
|
|
$(if $(PARALLEL_BUILD),\
|
2020-03-02 10:15:38 -06:00
|
|
|
$(call run_desktop_tests,$(subst $(DESKTOP_TRACK_FOLDER)/,,$(basename $@)),$(basename $@).log),\
|
2020-02-28 07:37:56 -06:00
|
|
|
$(call run_desktop_tests))
|
|
|
|
$(if $(PARALLEL_BUILD),\
|
|
|
|
@mkdir -p $(dir $@) && touch $@\
|
|
|
|
,\
|
|
|
|
@$(foreach done_file,$(DESKTOP_TEST_FILES_DONE),mkdir -p $(dir $(done_file)) && touch $(done_file) &&) true\
|
|
|
|
)
|
2020-01-14 12:37:17 -06:00
|
|
|
|
2020-07-29 05:06:10 -05:00
|
|
|
$(MULTIUSER_TESTS_DONE): $(PID_FILE) $(MOBILE_TEST_FILES_DONE)
|
2020-11-19 02:42:44 -06:00
|
|
|
$(foreach test,$(MULTIUSER_TESTS),$(call run_multiuser_test,$(test),$(1)))
|
2020-07-17 07:03:33 -05:00
|
|
|
@mkdir -p $(dir $@) && touch $@
|
|
|
|
|
2020-02-21 11:27:15 -06:00
|
|
|
check-desktop: @JAILS_PATH@ $(NODE_BINS)
|
2020-01-30 08:17:29 -06:00
|
|
|
$(call run_JS_error_check)
|
2020-01-14 12:37:17 -06:00
|
|
|
$(call start_loolwsd)
|
2020-01-15 07:55:03 -06:00
|
|
|
$(call run_desktop_tests,$(spec))
|
2020-02-20 03:03:42 -06:00
|
|
|
@$(KILL_COMMAND) || true
|
2020-01-14 12:37:17 -06:00
|
|
|
|
2020-02-21 11:27:15 -06:00
|
|
|
check-mobile: @JAILS_PATH@ $(NODE_BINS)
|
2020-01-30 08:17:29 -06:00
|
|
|
$(call run_JS_error_check)
|
2020-01-14 12:37:17 -06:00
|
|
|
$(call start_loolwsd)
|
2020-01-15 07:55:03 -06:00
|
|
|
$(call run_mobile_tests,$(spec))
|
2020-02-20 03:03:42 -06:00
|
|
|
@$(KILL_COMMAND) || true
|
2020-01-15 07:55:03 -06:00
|
|
|
|
2020-07-30 04:46:38 -05:00
|
|
|
check-multi: do-multi-check-log
|
|
|
|
$(if $(wildcard $(ERROR_LOG)),$(error CypressError: some tests failed!))
|
|
|
|
|
|
|
|
do-multi-check-log: do-multi-check
|
|
|
|
$(if $(wildcard $(ERROR_LOG)),@cat $(ERROR_LOG))
|
|
|
|
|
|
|
|
do-multi-check: @JAILS_PATH@ $(NODE_BINS)
|
2020-07-29 05:06:10 -05:00
|
|
|
@rm -f $(ERROR_LOG)
|
|
|
|
$(call run_JS_error_check)
|
|
|
|
$(call start_loolwsd)
|
|
|
|
$(if $(spec), \
|
|
|
|
$(call run_multiuser_test,$(spec)), \
|
|
|
|
$(call run_all_multiuser_tests))
|
|
|
|
@$(KILL_COMMAND) || true
|
|
|
|
|
2020-11-26 10:53:29 -06:00
|
|
|
check-interfer-mobile: do-interfer-mobile-check-log
|
|
|
|
$(if $(wildcard $(ERROR_LOG)),$(error CypressError: some tests failed!))
|
|
|
|
|
|
|
|
do-interfer-mobile-check-log: do-interfer-mobile-check
|
|
|
|
$(if $(wildcard $(ERROR_LOG)),@cat $(ERROR_LOG))
|
|
|
|
|
|
|
|
do-interfer-mobile-check: @JAILS_PATH@ $(NODE_BINS)
|
|
|
|
@rm -f $(ERROR_LOG)
|
|
|
|
$(call run_JS_error_check)
|
|
|
|
$(call start_loolwsd)
|
|
|
|
$(if $(spec), \
|
|
|
|
$(call run_mobile_interference_test,$(spec)), \
|
|
|
|
$(call run_mobile_interference_tests))
|
|
|
|
@$(KILL_COMMAND) || true
|
|
|
|
|
2020-02-21 11:27:15 -06:00
|
|
|
run-desktop: @JAILS_PATH@ $(NODE_BINS)
|
2020-04-08 03:43:07 -05:00
|
|
|
$(call run_JS_error_check)
|
2020-01-15 07:55:03 -06:00
|
|
|
$(call start_loolwsd)
|
|
|
|
@echo
|
|
|
|
@echo "Open cypress with desktop tests..."
|
|
|
|
@echo
|
2020-08-05 07:14:07 -05:00
|
|
|
$(call run_interactive_desktop,$(spec)) || true
|
2020-02-20 03:03:42 -06:00
|
|
|
@$(KILL_COMMAND) || true
|
2020-01-15 07:55:03 -06:00
|
|
|
|
2020-02-21 11:27:15 -06:00
|
|
|
run-mobile: @JAILS_PATH@ $(NODE_BINS)
|
2020-04-08 03:43:07 -05:00
|
|
|
$(call run_JS_error_check)
|
2020-01-15 07:55:03 -06:00
|
|
|
$(call start_loolwsd)
|
|
|
|
@echo
|
|
|
|
@echo "Open cypress with mobile tests..."
|
|
|
|
@echo
|
2020-08-05 07:14:07 -05:00
|
|
|
$(call run_interactive_mobile,$(spec)) || true
|
2020-02-20 03:03:42 -06:00
|
|
|
@$(KILL_COMMAND) || true
|
2020-01-14 12:14:18 -06:00
|
|
|
|
2020-08-05 07:11:56 -05:00
|
|
|
run-multi: @JAILS_PATH@ $(NODE_BINS)
|
|
|
|
$(call run_JS_error_check)
|
|
|
|
$(call start_loolwsd)
|
|
|
|
@echo
|
|
|
|
@echo "Running multi-user test in interactive test runner..."
|
|
|
|
@echo
|
|
|
|
$(if $(filter 1,$(user)), \
|
|
|
|
$(eval BACKGROUND_USER_SPEC=$(spec)_user2_spec.js), \
|
|
|
|
$(eval BACKGROUND_USER_SPEC=$(spec)_user1_spec.js))
|
|
|
|
$(if $(filter 1,$(user)), \
|
|
|
|
$(eval INTERACTIVE_USER_SPEC=$(spec)_user1_spec.js), \
|
|
|
|
$(eval INTERACTIVE_USER_SPEC=$(spec)_user2_spec.js))
|
|
|
|
$(eval BACKGROUND_USER_LOG=$(MULTIUSER_TRACK_FOLDER)/$(BACKGROUND_USER_SPEC).log)
|
|
|
|
@$(PARALLEL_SCRIPT) \
|
2020-08-10 09:24:30 -05:00
|
|
|
--browser $(BROWSER) \
|
2020-08-05 07:11:56 -05:00
|
|
|
--config $(MULTIUSER_CONFIG) \
|
|
|
|
--env $(MULTIUSER_ENV) \
|
|
|
|
--spec $(BACKGROUND_USER_SPEC) \
|
|
|
|
--type multi-user \
|
|
|
|
--log-file $(BACKGROUND_USER_LOG) &
|
|
|
|
$(call run_interactive_multi,$(INTERACTIVE_USER_SPEC)) || true
|
|
|
|
@$(KILL_COMMAND) || true
|
|
|
|
|
2020-08-04 21:37:07 -05:00
|
|
|
run-cov: do-run-cov
|
|
|
|
$(if $(wildcard $(ERROR_LOG)),@cat $(ERROR_LOG))
|
|
|
|
|
|
|
|
do-run-cov: @JAILS_PATH@ $(NODE_BINS)
|
2020-06-24 05:50:29 -05:00
|
|
|
@echo
|
|
|
|
@echo "Setup coverage tools..."
|
|
|
|
@echo
|
|
|
|
rm -rf .nyc_output
|
|
|
|
rm -rf coverage
|
|
|
|
npm install @cypress/code-coverage --no-save
|
|
|
|
@echo "import '@cypress/code-coverage/support';" >> $(SUPPORT_FILE_ABS)
|
|
|
|
@echo "" >> $(SUPPORT_FILE_ABS)
|
2020-06-25 09:55:47 -05:00
|
|
|
cd .. && npx nyc instrument --compact=false loleaflet/src loleaflet/dist/src && cd cypress_test
|
2020-06-24 05:50:29 -05:00
|
|
|
@echo
|
|
|
|
@echo "Run all tests..."
|
|
|
|
@echo
|
2020-08-04 21:37:07 -05:00
|
|
|
@rm -f $(ERROR_LOG)
|
2020-06-24 05:50:29 -05:00
|
|
|
$(call start_loolwsd)
|
2020-06-26 08:05:19 -05:00
|
|
|
$(call run_desktop_tests,,,COVERAGE_RUN="1")
|
|
|
|
$(call run_mobile_tests,,,COVERAGE_RUN="1")
|
2020-08-04 21:37:07 -05:00
|
|
|
$(call run_all_multiuser_tests,COVERAGE_RUN="1")
|
2020-06-24 05:50:29 -05:00
|
|
|
@$(KILL_COMMAND) || true
|
|
|
|
|
2020-07-06 05:46:02 -05:00
|
|
|
@JAILS_PATH@:
|
|
|
|
mkdir -p $@
|
|
|
|
|
2020-01-14 12:37:17 -06:00
|
|
|
define run_JS_error_check
|
2020-01-30 08:17:29 -06:00
|
|
|
@echo "Checking for JS errors in test code..."
|
|
|
|
@echo
|
2020-05-12 14:29:08 -05:00
|
|
|
@$(NODE) $(ESLINT_BINARY) $(abs_srcdir) \
|
2020-04-24 07:24:59 -05:00
|
|
|
--ignore-path $(abs_srcdir)/.eslintignore --config $(abs_srcdir)/.eslintrc
|
2020-01-10 09:38:37 -06:00
|
|
|
@echo
|
2020-01-14 12:37:17 -06:00
|
|
|
endef
|
|
|
|
|
|
|
|
define start_loolwsd
|
2020-09-03 08:52:40 -05:00
|
|
|
$(if $(findstring nextcloud, $(CYPRESS_INTEGRATION)),\
|
|
|
|
$(eval FREE_PORT:=9980),\
|
2020-09-14 08:53:51 -05:00
|
|
|
$(if $(findstring php-proxy, $(CYPRESS_INTEGRATION)),
|
|
|
|
$(eval FREE_PORT:=9982),\
|
|
|
|
$(eval FREE_PORT:=$(shell $(GET_PORT_BINARY) --host=127.0.0.1 $(ALLOWED_PORTS)))))
|
2020-02-19 19:25:01 -06:00
|
|
|
@echo "Found available port for testing: $(FREE_PORT)"
|
|
|
|
@echo
|
|
|
|
@echo "Launching loolwsd..."
|
2020-01-10 09:38:37 -06:00
|
|
|
@fc-cache "@LO_PATH@"/share/fonts/truetype
|
|
|
|
@echo
|
|
|
|
../loolwsd --o:sys_template_path="@SYSTEMPLATE_PATH@" \
|
|
|
|
--o:child_root_path="@JAILS_PATH@" --o:storage.filesystem[@allow]=true \
|
2020-01-22 05:55:00 -06:00
|
|
|
--disable-ssl \
|
2020-01-10 09:38:37 -06:00
|
|
|
--o:admin_console.username=admin --o:admin_console.password=admin \
|
2020-02-20 15:01:27 -06:00
|
|
|
--o:logging.file[@enable]=true --o:logging.level=trace \
|
2020-02-19 21:35:08 -06:00
|
|
|
--port=$(FREE_PORT) \
|
2020-02-20 15:01:27 -06:00
|
|
|
--pidfile=$(PID_FILE) \
|
2020-09-14 08:53:51 -05:00
|
|
|
$(if $(findstring php-proxy, $(CYPRESS_INTEGRATION)),--o:net.proxy_prefix=true) \
|
2020-02-20 15:01:27 -06:00
|
|
|
> /dev/null 2>&1 &
|
2020-02-21 11:27:15 -06:00
|
|
|
@$(WAIT_ON_BINARY) http://localhost:$(FREE_PORT) --timeout 60000
|
2020-01-10 09:38:37 -06:00
|
|
|
@echo
|
2020-01-14 12:37:17 -06:00
|
|
|
endef
|
|
|
|
|
2020-02-25 06:09:31 -06:00
|
|
|
#https://docs.cypress.io/guides/guides/continuous-integration.html#Xvfb
|
|
|
|
define start_Xvfb
|
|
|
|
@echo "Launching Xvfb..."
|
2020-05-10 05:08:07 -05:00
|
|
|
Xvfb :$(DISPLAY_NUMBER) -screen 0 1280x800x24 &
|
2020-02-28 10:17:08 -06:00
|
|
|
while [ ! -f /tmp/.X$(DISPLAY_NUMBER)-lock ] ; do sleep 1; done
|
2020-02-25 06:09:31 -06:00
|
|
|
@echo
|
|
|
|
endef
|
|
|
|
|
2020-05-22 15:55:18 -05:00
|
|
|
DESKTOP_CONFIG = \
|
2020-07-23 06:23:14 -05:00
|
|
|
integrationFolder=$(DESKTOP_TEST_FOLDER),supportFile=$(SUPPORT_FILE),userAgent=$(DESKTOP_USER_AGENT)
|
|
|
|
|
|
|
|
DESKTOP_ENV = \
|
2020-09-03 08:52:40 -05:00
|
|
|
DATA_FOLDER=$(DESKTOP_DATA_FOLDER),WORKDIR=$(DESKTOP_WORKDIR),WSD_VERSION_HASH=$(LOOLWSD_VERSION_HASH),SERVER_PORT=$(FREE_PORT),LO_CORE_VERSION="$(CORE_VERSION)",INTEGRATION=$(CYPRESS_INTEGRATION)
|
2020-05-18 09:04:00 -05:00
|
|
|
|
2020-05-22 15:55:18 -05:00
|
|
|
MOBILE_CONFIG = \
|
2020-07-23 06:23:14 -05:00
|
|
|
integrationFolder=$(MOBILE_TEST_FOLDER),supportFile=$(SUPPORT_FILE),userAgent=$(MOBILE_USER_AGENT)
|
|
|
|
|
|
|
|
MOBILE_ENV = \
|
2020-09-03 08:52:40 -05:00
|
|
|
DATA_FOLDER=$(MOBILE_DATA_FOLDER),WORKDIR=$(MOBILE_WORKDIR),WSD_VERSION_HASH=$(LOOLWSD_VERSION_HASH),SERVER_PORT=$(FREE_PORT),LO_CORE_VERSION="$(CORE_VERSION)",INTEGRATION=$(CYPRESS_INTEGRATION)
|
2020-05-18 09:04:00 -05:00
|
|
|
|
2020-07-17 07:03:33 -05:00
|
|
|
MULTIUSER_CONFIG = \
|
2020-11-18 08:27:02 -06:00
|
|
|
integrationFolder=$(MULTIUSER_TEST_FOLDER),supportFile=$(SUPPORT_FILE),userAgent=$(DESKTOP_USER_AGENT),defaultCommandTimeout=30000,retries=0
|
2020-07-23 06:23:14 -05:00
|
|
|
|
|
|
|
MULTIUSER_ENV = \
|
2020-09-03 08:52:40 -05:00
|
|
|
DATA_FOLDER=$(MULTIUSER_DATA_FOLDER),WORKDIR=$(MULTIUSER_WORKDIR),WSD_VERSION_HASH=$(LOOLWSD_VERSION_HASH),SERVER_PORT=$(FREE_PORT),LO_CORE_VERSION="$(CORE_VERSION)",INTEGRATION=$(CYPRESS_INTEGRATION)
|
2020-07-17 07:03:33 -05:00
|
|
|
|
2020-08-05 07:14:07 -05:00
|
|
|
define run_interactive_desktop
|
|
|
|
$(if $(1),\
|
2020-05-22 15:55:18 -05:00
|
|
|
$(CYPRESS_BINARY) run \
|
2020-08-10 09:24:30 -05:00
|
|
|
--browser $(BROWSER) \
|
2020-05-22 15:55:18 -05:00
|
|
|
--headed --no-exit \
|
2020-08-05 07:14:07 -05:00
|
|
|
--config $(DESKTOP_CONFIG) \
|
|
|
|
--env $(DESKTOP_ENV) \
|
|
|
|
--spec=$(abs_dir)/integration_tests/desktop/$(1),\
|
|
|
|
$(CYPRESS_BINARY) open \
|
|
|
|
--config $(DESKTOP_CONFIG) \
|
|
|
|
--env $(DESKTOP_ENV))
|
|
|
|
endef
|
|
|
|
|
|
|
|
define run_interactive_mobile
|
|
|
|
$(if $(1),\
|
|
|
|
$(CYPRESS_BINARY) run \
|
2020-08-10 09:24:30 -05:00
|
|
|
--browser $(BROWSER) \
|
2020-08-05 07:14:07 -05:00
|
|
|
--headed --no-exit \
|
|
|
|
--config $(MOBILE_CONFIG) \
|
|
|
|
--env $(MOBILE_ENV) \
|
|
|
|
--spec=$(abs_dir)/integration_tests/mobile/$(1),\
|
2020-05-22 15:55:18 -05:00
|
|
|
$(CYPRESS_BINARY) open \
|
2020-08-05 07:14:07 -05:00
|
|
|
--config $(MOBILE_CONFIG) \
|
|
|
|
--env $(MOBILE_ENV))
|
2020-05-18 09:04:00 -05:00
|
|
|
endef
|
|
|
|
|
2020-08-05 07:11:56 -05:00
|
|
|
define run_interactive_multi
|
|
|
|
$(CYPRESS_BINARY) run \
|
2020-08-10 09:24:30 -05:00
|
|
|
--browser $(BROWSER) \
|
2020-08-05 07:11:56 -05:00
|
|
|
--headed --no-exit \
|
|
|
|
--config $(MULTIUSER_CONFIG) \
|
|
|
|
--env $(MULTIUSER_ENV) \
|
|
|
|
--spec=$(abs_dir)/integration_tests/multiuser/$(1)
|
|
|
|
endef
|
|
|
|
|
2020-01-14 12:37:17 -06:00
|
|
|
define run_desktop_tests
|
2020-02-22 04:48:33 -06:00
|
|
|
@echo $(if $(1),"Running cypress desktop test: $(1)","Running cypress desktop tests...")
|
2020-01-14 12:37:17 -06:00
|
|
|
@echo
|
2020-07-23 06:23:14 -05:00
|
|
|
$(if $(PARALLEL_BUILD),\
|
|
|
|
@$(PARALLEL_SCRIPT) \
|
2020-08-10 09:24:30 -05:00
|
|
|
--browser $(BROWSER) \
|
2020-07-23 06:23:14 -05:00
|
|
|
--config $(DESKTOP_CONFIG) \
|
|
|
|
--env $(DESKTOP_ENV)$(if $(3),$(COMMA)$(3)) \
|
|
|
|
--spec $(1) \
|
|
|
|
--type desktop \
|
|
|
|
--log-file $(2) \
|
|
|
|
,\
|
2020-05-22 15:55:18 -05:00
|
|
|
$(CYPRESS_BINARY) run \
|
2020-08-10 09:24:30 -05:00
|
|
|
--browser $(BROWSER) \
|
2020-01-14 10:10:07 -06:00
|
|
|
--headless \
|
2020-07-23 06:23:14 -05:00
|
|
|
--config $(DESKTOP_CONFIG) \
|
|
|
|
--env $(DESKTOP_ENV)$(if $(3),$(COMMA)$(3)) \
|
2020-02-21 12:53:52 -06:00
|
|
|
$(if $(1), --spec=$(abs_dir)/integration_tests/desktop/$(1)) \
|
2020-07-23 06:23:14 -05:00
|
|
|
|| ($(KILL_COMMAND) && false) \
|
2020-03-02 10:15:38 -06:00
|
|
|
)
|
2020-01-14 12:37:17 -06:00
|
|
|
endef
|
|
|
|
|
|
|
|
define run_mobile_tests
|
2020-02-22 04:48:33 -06:00
|
|
|
@echo $(if $(1),"Running cypress mobile test: $(1)","Running cypress mobile tests...")
|
2020-01-10 09:38:37 -06:00
|
|
|
@echo
|
2020-07-23 06:23:14 -05:00
|
|
|
$(if $(PARALLEL_BUILD),\
|
|
|
|
@$(PARALLEL_SCRIPT) \
|
2020-08-10 09:24:30 -05:00
|
|
|
--browser $(BROWSER) \
|
2020-07-23 06:23:14 -05:00
|
|
|
--config $(MOBILE_CONFIG) \
|
|
|
|
--env $(MOBILE_ENV)$(if $(3),$(COMMA)$(3)) \
|
|
|
|
--spec $(1) \
|
|
|
|
--type mobile \
|
|
|
|
--log-file $(2) \
|
|
|
|
,\
|
2020-05-22 15:55:18 -05:00
|
|
|
$(CYPRESS_BINARY) run \
|
2020-08-10 09:24:30 -05:00
|
|
|
--browser $(BROWSER) \
|
2020-01-14 10:10:07 -06:00
|
|
|
--headless \
|
2020-07-23 06:23:14 -05:00
|
|
|
--config $(MOBILE_CONFIG) \
|
|
|
|
--env $(MOBILE_ENV)$(if $(3),$(COMMA)$(3)) \
|
2020-02-13 05:57:37 -06:00
|
|
|
$(if $(1), --spec=$(abs_dir)/integration_tests/mobile/$(1)) \
|
2020-07-23 06:23:14 -05:00
|
|
|
|| ($(KILL_COMMAND) && false) \
|
2020-03-02 10:15:38 -06:00
|
|
|
)
|
|
|
|
endef
|
|
|
|
|
2020-07-29 05:06:10 -05:00
|
|
|
define run_all_multiuser_tests
|
2020-08-04 21:37:07 -05:00
|
|
|
$(foreach test,$(MULTIUSER_TESTS),$(call run_multiuser_test,$(test),$(1)))
|
2020-07-29 05:06:10 -05:00
|
|
|
endef
|
|
|
|
|
|
|
|
define run_multiuser_test
|
|
|
|
$(eval USER1_SPEC=$(strip $(1))_user1_spec.js)
|
|
|
|
$(eval USER2_SPEC=$(strip $(1))_user2_spec.js)
|
|
|
|
$(eval USER1_LOG=$(MULTIUSER_TRACK_FOLDER)/$(USER1_SPEC).log)
|
|
|
|
$(eval USER2_LOG=$(MULTIUSER_TRACK_FOLDER)/$(USER2_SPEC).log)
|
|
|
|
@echo "Running cypress multi-user test: $(USER1_SPEC) - $(USER2_SPEC)"
|
2020-07-17 07:03:33 -05:00
|
|
|
@echo
|
2020-07-27 08:33:27 -05:00
|
|
|
@$(PARALLEL_SCRIPT) \
|
2020-08-10 09:24:30 -05:00
|
|
|
--browser $(BROWSER) \
|
2020-07-27 08:33:27 -05:00
|
|
|
--config $(MULTIUSER_CONFIG) \
|
2020-08-04 21:37:07 -05:00
|
|
|
--env $(MULTIUSER_ENV)$(if $(2),$(COMMA)$(2)) \
|
2020-07-29 05:06:10 -05:00
|
|
|
--spec $(USER1_SPEC) \
|
2020-07-27 08:33:27 -05:00
|
|
|
--type multi-user \
|
2020-07-29 05:06:10 -05:00
|
|
|
--log-file $(USER1_LOG) & \
|
2020-11-18 08:19:05 -06:00
|
|
|
sleep 5 && \
|
2020-07-27 08:33:27 -05:00
|
|
|
$(PARALLEL_SCRIPT) \
|
2020-08-10 09:24:30 -05:00
|
|
|
--browser $(BROWSER) \
|
2020-07-27 08:33:27 -05:00
|
|
|
--config $(MULTIUSER_CONFIG) \
|
2020-08-04 21:37:07 -05:00
|
|
|
--env $(MULTIUSER_ENV)$(if $(2),$(COMMA)$(2)) \
|
2020-07-29 05:06:10 -05:00
|
|
|
--spec $(USER2_SPEC) \
|
2020-07-27 08:33:27 -05:00
|
|
|
--type multi-user \
|
2020-07-29 05:06:10 -05:00
|
|
|
--log-file $(USER2_LOG) && \
|
2020-07-27 08:33:27 -05:00
|
|
|
wait # waits the background process to be finished
|
2020-05-20 10:34:28 -05:00
|
|
|
endef
|
|
|
|
|
2020-11-26 10:53:29 -06:00
|
|
|
INTERFER_MOBILE_CONFIG1 = \
|
|
|
|
integrationFolder=$(MOBILE_TEST_FOLDER),supportFile=$(SUPPORT_FILE),userAgent=$(MOBILE_USER_AGENT),defaultCommandTimeout=30000,retries=0
|
|
|
|
|
|
|
|
INTERFER_MOBILE_ENV1 = \
|
|
|
|
DATA_FOLDER=$(MOBILE_DATA_FOLDER),WORKDIR=$(MULTIUSER_WORKDIR),WSD_VERSION_HASH=$(LOOLWSD_VERSION_HASH),SERVER_PORT=$(FREE_PORT),LO_CORE_VERSION="$(CORE_VERSION)",INTEGRATION=$(CYPRESS_INTEGRATION),INTERFERENCE_TEST=true
|
|
|
|
|
|
|
|
INTERFER_MOBILE_CONFIG2 = \
|
|
|
|
integrationFolder=$(MULTIUSER_TEST_FOLDER),supportFile=$(SUPPORT_FILE),userAgent=$(MOBILE_USER_AGENT),defaultCommandTimeout=30000,retries=0
|
|
|
|
|
|
|
|
INTERFER_MOBILE_ENV2 = \
|
|
|
|
DATA_FOLDER=$(MOBILE_DATA_FOLDER),WORKDIR=$(MULTIUSER_WORKDIR),WSD_VERSION_HASH=$(LOOLWSD_VERSION_HASH),SERVER_PORT=$(FREE_PORT),LO_CORE_VERSION="$(CORE_VERSION)",INTEGRATION=$(CYPRESS_INTEGRATION)
|
|
|
|
|
|
|
|
define run_mobile_interference_tests
|
|
|
|
$(foreach test,$(MOBILE_TEST_FILES),$(call run_mobile_interference_test,$(test)))
|
|
|
|
endef
|
|
|
|
|
|
|
|
define run_mobile_interference_test
|
|
|
|
$(eval USER1_SPEC=$(1))
|
|
|
|
$(eval USER2_SPEC=interference_user_spec.js)
|
|
|
|
$(eval USER1_LOG=$(MULTIUSER_TRACK_FOLDER)/$(USER1_SPEC).log)
|
|
|
|
$(eval USER2_LOG=$(MULTIUSER_TRACK_FOLDER)/$(USER2_SPEC).log)
|
|
|
|
@echo "Running cypress mobile interference test: $(1)"
|
|
|
|
@echo
|
|
|
|
@$(PARALLEL_SCRIPT) \
|
|
|
|
--browser $(BROWSER) \
|
|
|
|
--config $(INTERFER_MOBILE_CONFIG1) \
|
|
|
|
--env $(INTERFER_MOBILE_ENV1) \
|
|
|
|
--spec $(USER1_SPEC) \
|
|
|
|
--type mobile \
|
|
|
|
--log-file $(USER1_LOG) & \
|
|
|
|
sleep 5 && \
|
|
|
|
$(PARALLEL_SCRIPT) \
|
|
|
|
--browser $(BROWSER) \
|
|
|
|
--config $(INTERFER_MOBILE_CONFIG2) \
|
|
|
|
--env $(INTERFER_MOBILE_ENV2) \
|
|
|
|
--spec $(USER2_SPEC) \
|
|
|
|
--type multi-user \
|
|
|
|
--log-file $(USER2_LOG) && \
|
|
|
|
wait # waits the background process to be finished
|
|
|
|
endef
|
|
|
|
|
2020-02-21 11:27:15 -06:00
|
|
|
NODE_BINS = \
|
|
|
|
$(CYPRESS_BINARY) \
|
|
|
|
$(ESLINT_BINARY) \
|
|
|
|
$(WAIT_ON_BINARY) \
|
|
|
|
$(GET_PORT_BINARY)
|
|
|
|
|
2020-02-23 04:46:17 -06:00
|
|
|
$(NODE_BINS): $(NPM_INSTALLED);
|
|
|
|
|
2020-04-28 23:37:34 -05:00
|
|
|
$(NPM_INSTALLED): package.json eslint_plugin/index.js eslint_plugin/package.json
|
2020-01-15 08:27:30 -06:00
|
|
|
@npm install
|
2020-02-23 04:46:17 -06:00
|
|
|
@mkdir -p $(dir $(NPM_INSTALLED))
|
|
|
|
@touch $(NPM_INSTALLED)
|
2020-01-15 08:27:30 -06:00
|
|
|
|
2020-10-05 05:47:10 -05:00
|
|
|
else
|
|
|
|
|
|
|
|
check-local:
|
|
|
|
$(error CypressError: Can't find LibreOffice core installation!)
|
|
|
|
|
2020-01-12 06:05:04 -06:00
|
|
|
endif
|
2020-01-10 09:38:37 -06:00
|
|
|
|
|
|
|
clean-local:
|
|
|
|
rm -rf node_modules
|
2020-01-14 11:08:51 -06:00
|
|
|
rm -rf workdir
|
2020-01-14 11:14:23 -06:00
|
|
|
rm -rf cypress
|
2020-01-14 11:19:09 -06:00
|
|
|
rm -rf package-lock.json
|
2020-06-24 05:50:29 -05:00
|
|
|
rm -rf .nyc_output
|
|
|
|
rm -rf coverage
|
2020-01-23 07:46:07 -06:00
|
|
|
endif
|