[Libreoffice-commits] online.git: cypress_test/Makefile.am

Tamás Zolnai (via logerrit) logerrit at kemper.freedesktop.org
Wed Aug 5 12:56:35 UTC 2020


 cypress_test/Makefile.am |   32 ++++++++++++++++++++++++++++++++
 1 file changed, 32 insertions(+)

New commits:
commit c34aca25889d24e9283596059befaf95ee9ae8c6
Author:     Tamás Zolnai <tamas.zolnai at collabora.com>
AuthorDate: Wed Aug 5 14:11:56 2020 +0200
Commit:     Tamás Zolnai <tamas.zolnai at collabora.com>
CommitDate: Wed Aug 5 14:56:17 2020 +0200

    cypress: add make run-multi command.
    
    To run multi-user tests in interactive test runner.
    It has two non-optional parameter. 'spec' defines the
    test file and 'user' defines which user is run in the
    interactive test runner. The other user is run in the
    background.
    
    Change-Id: I8612c201d7d3aeb2bdadd9d3786fb8eb0b60ab55
    Reviewed-on: https://gerrit.libreoffice.org/c/online/+/100167
    Tested-by: Jenkins
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
    Reviewed-by: Tamás Zolnai <tamas.zolnai at collabora.com>

diff --git a/cypress_test/Makefile.am b/cypress_test/Makefile.am
index 64dbf40a2..10527df83 100644
--- a/cypress_test/Makefile.am
+++ b/cypress_test/Makefile.am
@@ -163,6 +163,29 @@ run-mobile: @JAILS_PATH@ $(NODE_BINS)
 			|| true
 	@$(KILL_COMMAND) || true
 
+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) \
+		--browser $(CHROME) \
+		--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
+
 run-cov: do-run-cov
 	$(if $(wildcard $(ERROR_LOG)), at cat $(ERROR_LOG))
 
@@ -264,6 +287,15 @@ define run_interactive_test
 				--env $(MOBILE_ENV) \))
 endef
 
+define run_interactive_multi
+	$(CYPRESS_BINARY) run \
+		--browser $(CHROME) \
+		--headed --no-exit \
+		--config $(MULTIUSER_CONFIG) \
+		--env $(MULTIUSER_ENV) \
+		--spec=$(abs_dir)/integration_tests/multiuser/$(1)
+endef
+
 define run_desktop_tests
 	@echo $(if $(1),"Running cypress desktop test: $(1)","Running cypress desktop tests...")
 	@echo


More information about the Libreoffice-commits mailing list