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

Tamás Zolnai (via logerrit) logerrit at kemper.freedesktop.org
Tue Aug 11 10:09:17 UTC 2020


 cypress_test/Makefile.am |   38 ++++++++++++++++++++++++++++----------
 1 file changed, 28 insertions(+), 10 deletions(-)

New commits:
commit b56cff65204f91dfa43d237f1096292266db735c
Author:     Tamás Zolnai <tamas.zolnai at collabora.com>
AuthorDate: Mon Aug 10 16:24:30 2020 +0200
Commit:     Tamás Zolnai <tamas.zolnai at collabora.com>
CommitDate: Tue Aug 11 12:08:58 2020 +0200

    cypress: introduce make check-firefox command.
    
    To run all cypress tests inside firefox browser.
    
    Change-Id: I965666e8b6b7aad5a45d1fef4fc9a078aa30615d
    Reviewed-on: https://gerrit.libreoffice.org/c/online/+/100441
    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 230f8dc7d..4ab2d2b61 100644
--- a/cypress_test/Makefile.am
+++ b/cypress_test/Makefile.am
@@ -47,6 +47,8 @@ SPACE :=$(EMPTY) $(EMPTY)
 
 CORE_VERSION := $(subst $(SPACE),_,$(shell "@LO_PATH@"/program/soffice.bin --version 2> /dev/null))
 
+BROWSER:=$(CHROME)
+
 if ENABLE_DEBUG
 FILTER_DEBUG=cypress:electron,cypress:launcher
 export DEBUG=$(if $(ENABLE_LOGGING),$(FILTER_DEBUG),)
@@ -171,7 +173,7 @@ run-multi: @JAILS_PATH@ $(NODE_BINS)
 		$(eval INTERACTIVE_USER_SPEC=$(spec)_user2_spec.js))
 	$(eval BACKGROUND_USER_LOG=$(MULTIUSER_TRACK_FOLDER)/$(BACKGROUND_USER_SPEC).log)
 	@$(PARALLEL_SCRIPT) \
-		--browser $(CHROME) \
+		--browser $(BROWSER) \
 		--config $(MULTIUSER_CONFIG) \
 		--env $(MULTIUSER_ENV) \
 		--spec $(BACKGROUND_USER_SPEC) \
@@ -203,6 +205,22 @@ do-run-cov: @JAILS_PATH@ $(NODE_BINS)
 	$(call run_all_multiuser_tests,COVERAGE_RUN="1")
 	@$(KILL_COMMAND) || true
 
+
+check-firefox: do-check-firefox
+	$(if $(wildcard $(ERROR_LOG)), at cat $(ERROR_LOG))
+
+do-check-firefox: @JAILS_PATH@ $(NODE_BINS)
+	@echo
+	@echo "Run tests inside Firefox..."
+	@echo
+	@rm -f $(ERROR_LOG)
+	$(eval BROWSER="firefox")
+	$(call start_loolwsd)
+	$(call run_desktop_tests)
+	$(call run_mobile_tests)
+	$(call run_all_multiuser_tests)
+	@$(KILL_COMMAND) || true
+
 @JAILS_PATH@:
 	mkdir -p $@
 
@@ -262,7 +280,7 @@ MULTIUSER_ENV = \
 define run_interactive_desktop
 	$(if $(1),\
 		$(CYPRESS_BINARY) run \
-			--browser $(CHROME) \
+			--browser $(BROWSER) \
 			--headed --no-exit \
 			--config $(DESKTOP_CONFIG) \
 			--env $(DESKTOP_ENV) \
@@ -275,7 +293,7 @@ endef
 define run_interactive_mobile
 	$(if $(1),\
 		$(CYPRESS_BINARY) run \
-			--browser $(CHROME) \
+			--browser $(BROWSER) \
 			--headed --no-exit \
 			--config $(MOBILE_CONFIG) \
 			--env $(MOBILE_ENV) \
@@ -287,7 +305,7 @@ endef
 
 define run_interactive_multi
 	$(CYPRESS_BINARY) run \
-		--browser $(CHROME) \
+		--browser $(BROWSER) \
 		--headed --no-exit \
 		--config $(MULTIUSER_CONFIG) \
 		--env $(MULTIUSER_ENV) \
@@ -299,7 +317,7 @@ define run_desktop_tests
 	@echo
 	$(if $(PARALLEL_BUILD),\
 		@$(PARALLEL_SCRIPT) \
-			--browser $(CHROME) \
+			--browser $(BROWSER) \
 			--config $(DESKTOP_CONFIG) \
 			--env $(DESKTOP_ENV)$(if $(3),$(COMMA)$(3)) \
 			--spec $(1) \
@@ -308,7 +326,7 @@ define run_desktop_tests
 			--second-chance \
 		,\
 		$(CYPRESS_BINARY) run \
-			--browser $(CHROME) \
+			--browser $(BROWSER) \
 			--headless \
 			--config $(DESKTOP_CONFIG) \
 			--env $(DESKTOP_ENV)$(if $(3),$(COMMA)$(3)) \
@@ -322,7 +340,7 @@ define run_mobile_tests
 	@echo
 	$(if $(PARALLEL_BUILD),\
 		@$(PARALLEL_SCRIPT) \
-			--browser $(CHROME) \
+			--browser $(BROWSER) \
 			--config $(MOBILE_CONFIG) \
 			--env $(MOBILE_ENV)$(if $(3),$(COMMA)$(3)) \
 			--spec $(1) \
@@ -331,7 +349,7 @@ define run_mobile_tests
 			--second-chance \
 		,\
 		$(CYPRESS_BINARY) run \
-			--browser $(CHROME) \
+			--browser $(BROWSER) \
 			--headless \
 			--config $(MOBILE_CONFIG) \
 			--env $(MOBILE_ENV)$(if $(3),$(COMMA)$(3)) \
@@ -352,14 +370,14 @@ define run_multiuser_test
 	@echo "Running cypress multi-user test: $(USER1_SPEC) - $(USER2_SPEC)"
 	@echo
 	@$(PARALLEL_SCRIPT) \
-		--browser $(CHROME) \
+		--browser $(BROWSER) \
 		--config $(MULTIUSER_CONFIG) \
 		--env $(MULTIUSER_ENV)$(if $(2),$(COMMA)$(2)) \
 		--spec $(USER1_SPEC) \
 		--type multi-user \
 		--log-file $(USER1_LOG) & \
 	$(PARALLEL_SCRIPT) \
-		--browser $(CHROME) \
+		--browser $(BROWSER) \
 		--config $(MULTIUSER_CONFIG) \
 		--env $(MULTIUSER_ENV)$(if $(2),$(COMMA)$(2)) \
 		--spec $(USER2_SPEC) \


More information about the Libreoffice-commits mailing list