[Libreoffice-commits] online.git: 2 commits - configure.ac cypress_test/cypress.json cypress_test/Makefile.am cypress_test/README
Henry Castro (via logerrit)
logerrit at kemper.freedesktop.org
Fri May 22 19:09:17 UTC 2020
configure.ac | 1 -
cypress_test/Makefile.am | 25 +++++++++++++++++++------
cypress_test/README | 3 +++
cypress_test/cypress.json | 1 -
4 files changed, 22 insertions(+), 8 deletions(-)
New commits:
commit defe39ac29748ef30c3621f3f3c14229445b8ad3
Author: Henry Castro <hcastro at collabora.com>
AuthorDate: Mon May 18 10:04:00 2020 -0400
Commit: Tamás Zolnai <tamas.zolnai at collabora.com>
CommitDate: Fri May 22 21:09:07 2020 +0200
cypress: run interactive specific unit test
If unit test fails, so we can run interactive unit
test to analyse the results (command line)
Change-Id: I44fff4a442b2f6be0dbfced1359e27fc07c2c12e
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/94426
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 456824a6d..15c09a916 100644
--- a/cypress_test/Makefile.am
+++ b/cypress_test/Makefile.am
@@ -106,8 +106,7 @@ run-desktop: @JAILS_PATH@ $(NODE_BINS)
@echo
@echo "Open cypress with desktop tests..."
@echo
- $(CYPRESS_BINARY) open --config integrationFolder=$(DESKTOP_TEST_FOLDER),supportFile=$(SUPPORT_FILE),userAgent=$(DESKTOP_USER_AGENT) \
- --env DATA_FOLDER=$(DESKTOP_DATA_FOLDER),WORKDIR=$(DESKTOP_WORKDIR),WSD_VERSION_HASH=$(WSD_VERSION_HASH),SERVER_PORT=$(FREE_PORT) \
+ $(call run_interactive_test,DESKTOP,$(spec)) \
|| true
@$(KILL_COMMAND) || true
@@ -117,8 +116,7 @@ run-mobile: @JAILS_PATH@ $(NODE_BINS)
@echo
@echo "Open cypress with mobile tests..."
@echo
- $(CYPRESS_BINARY) open --config integrationFolder=$(MOBILE_TEST_FOLDER),supportFile=$(SUPPORT_FILE),userAgent=$(MOBILE_USER_AGENT) \
- --env DATA_FOLDER=$(MOBILE_DATA_FOLDER),WORKDIR=$(MOBILE_WORKDIR),WSD_VERSION_HASH=$(WSD_VERSION_HASH),SERVER_PORT=$(FREE_PORT) \
+ $(call run_interactive_test,MOBILE,$(spec)) \
|| true
@$(KILL_COMMAND) || true
@@ -157,6 +155,19 @@ define start_Xvfb
@echo
endef
+DESKTOP_CONFIG = --config integrationFolder=$(DESKTOP_TEST_FOLDER),supportFile=$(SUPPORT_FILE),userAgent=$(DESKTOP_USER_AGENT) --env DATA_FOLDER=$(DESKTOP_DATA_FOLDER),WORKDIR=$(DESKTOP_WORKDIR),WSD_VERSION_HASH=$(WSD_VERSION_HASH),SERVER_PORT=$(FREE_PORT)
+
+MOBILE_CONFIG = --config integrationFolder=$(MOBILE_TEST_FOLDER),supportFile=$(SUPPORT_FILE),userAgent=$(MOBILE_USER_AGENT) --env DATA_FOLDER=$(MOBILE_DATA_FOLDER),WORKDIR=$(MOBILE_WORKDIR),WSD_VERSION_HASH=$(WSD_VERSION_HASH),SERVER_PORT=$(FREE_PORT)
+
+define run_interactive_test
+ $(if $(2),\
+ $(CYPRESS_BINARY) run --browser $(CHROME) --headed --no-exit \
+ $(if $(findstring DESKTOP,$(1)),\
+ $(DESKTOP_CONFIG) --spec=$(abs_dir)/integration_tests/desktop/$(2),\
+ $(MOBILE_CONFIG) --spec=$(abs_dir)/integration_tests/mobile/$(2)),\
+ $(CYPRESS_BINARY) open $(if $(findstring DESKTOP,$(1)),$(DESKTOP_CONFIG),$(MOBILE_CONFIG)))
+endef
+
define run_desktop_tests
@echo $(if $(1),"Running cypress desktop test: $(1)","Running cypress desktop tests...")
@echo
diff --git a/cypress_test/README b/cypress_test/README
index 51d701d11..7f0fe321a 100644
--- a/cypress_test/README
+++ b/cypress_test/README
@@ -78,6 +78,9 @@ Or open the file in the interactive test runner.
make run-mobile
+Or run specific unit test:
+
+ make run-mobile spec=writer/apply_font_spec.js
Openning interactive test runner
----------------------------------
commit 16028271bbcc6e745080b71c272b90311e1c682e
Author: Henry Castro <hcastro at collabora.com>
AuthorDate: Mon May 18 09:36:26 2020 -0400
Commit: Tamás Zolnai <tamas.zolnai at collabora.com>
CommitDate: Fri May 22 21:08:59 2020 +0200
cypress: fix running single unit test
When builddir != srcdir
Stills error:
"The support file is missing or invalid.
Your `supportFile` is set to `cypress_test/support/index.js`, but either
the file is missing or it's invalid. The `supportFile` must be a `.js`
or `.coffee` file or, if you're using a preprocessor plugin, it must be
supported by that plugin.
Correct your `cypress.json`, create the appropriate file, or set
`supportFile` to `false` if a support file is not necessary for your
project."
Change-Id: If1aeb55a3821735022dfa57af217130f18cd9dbf
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/94424
Tested-by: Jenkins
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
Reviewed-by: Tamás Zolnai <tamas.zolnai at collabora.com>
diff --git a/configure.ac b/configure.ac
index f3a13a3ab..3b2edb7c1 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1000,7 +1000,6 @@ AC_CONFIG_LINKS([cypress_test/cypress.json:cypress_test/cypress.json])
AC_LINK_FILES([cypress_test/plugins], [cypress_test/plugins])
AC_LINK_FILES([loleaflet/archived-packages], [loleaflet/archived-packages])
AC_LINK_FILES([cypress_test/eslint_plugin], [cypress_test/eslint_plugin])
-AC_LINK_FILES([cypress_test/support], [cypress_test/support])
APP_BRANDING_DIR=
APP_IC_LAUNCHER="ic_launcher"
diff --git a/cypress_test/Makefile.am b/cypress_test/Makefile.am
index 6f9bcdb09..456824a6d 100644
--- a/cypress_test/Makefile.am
+++ b/cypress_test/Makefile.am
@@ -12,6 +12,8 @@ NPM_INSTALLED = $(abs_builddir)/workdir/npm_installed
PID_FILE=$(abs_builddir)/workdir/loolwsd.pid
ERROR_LOG=$(abs_builddir)/workdir/error.log
+SUPPORT_FILE = $(abs_srcdir)/support/index.js
+
DESKTOP_USER_AGENT = "cypress"
DESKTOP_TEST_FOLDER = $(abs_srcdir)/integration_tests/desktop
DESKTOP_DATA_FOLDER = $(abs_srcdir)/data/desktop/
@@ -104,7 +106,7 @@ run-desktop: @JAILS_PATH@ $(NODE_BINS)
@echo
@echo "Open cypress with desktop tests..."
@echo
- $(CYPRESS_BINARY) open --config integrationFolder=$(DESKTOP_TEST_FOLDER),userAgent=$(DESKTOP_USER_AGENT) \
+ $(CYPRESS_BINARY) open --config integrationFolder=$(DESKTOP_TEST_FOLDER),supportFile=$(SUPPORT_FILE),userAgent=$(DESKTOP_USER_AGENT) \
--env DATA_FOLDER=$(DESKTOP_DATA_FOLDER),WORKDIR=$(DESKTOP_WORKDIR),WSD_VERSION_HASH=$(WSD_VERSION_HASH),SERVER_PORT=$(FREE_PORT) \
|| true
@$(KILL_COMMAND) || true
@@ -115,7 +117,7 @@ run-mobile: @JAILS_PATH@ $(NODE_BINS)
@echo
@echo "Open cypress with mobile tests..."
@echo
- $(CYPRESS_BINARY) open --config integrationFolder=$(MOBILE_TEST_FOLDER),userAgent=$(MOBILE_USER_AGENT) \
+ $(CYPRESS_BINARY) open --config integrationFolder=$(MOBILE_TEST_FOLDER),supportFile=$(SUPPORT_FILE),userAgent=$(MOBILE_USER_AGENT) \
--env DATA_FOLDER=$(MOBILE_DATA_FOLDER),WORKDIR=$(MOBILE_WORKDIR),WSD_VERSION_HASH=$(WSD_VERSION_HASH),SERVER_PORT=$(FREE_PORT) \
|| true
@$(KILL_COMMAND) || true
@@ -160,7 +162,7 @@ define run_desktop_tests
@echo
$(eval RUN_COMMAND = \
$(CYPRESS_BINARY) run --browser $(CHROME) \
- --config integrationFolder=$(DESKTOP_TEST_FOLDER),userAgent=$(DESKTOP_USER_AGENT) \
+ --config integrationFolder=$(DESKTOP_TEST_FOLDER),supportFile=$(SUPPORT_FILE),userAgent=$(DESKTOP_USER_AGENT) \
--headless \
--env DATA_FOLDER=$(DESKTOP_DATA_FOLDER),WORKDIR=$(DESKTOP_WORKDIR),WSD_VERSION_HASH=$(WSD_VERSION_HASH),SERVER_PORT=$(FREE_PORT) \
$(if $(1), --spec=$(abs_dir)/integration_tests/desktop/$(1)) \
@@ -177,7 +179,7 @@ define run_mobile_tests
@echo
$(eval RUN_COMMAND = \
$(CYPRESS_BINARY) run --browser $(CHROME) \
- --config integrationFolder=$(MOBILE_TEST_FOLDER),userAgent=$(MOBILE_USER_AGENT) \
+ --config integrationFolder=$(MOBILE_TEST_FOLDER),supportFile=$(SUPPORT_FILE),userAgent=$(MOBILE_USER_AGENT) \
--headless \
--env DATA_FOLDER=$(MOBILE_DATA_FOLDER),WORKDIR=$(MOBILE_WORKDIR),WSD_VERSION_HASH=$(WSD_VERSION_HASH),SERVER_PORT=$(FREE_PORT) \
$(if $(1), --spec=$(abs_dir)/integration_tests/mobile/$(1)) \
diff --git a/cypress_test/cypress.json b/cypress_test/cypress.json
index 5f4c1c407..f8f277eb2 100644
--- a/cypress_test/cypress.json
+++ b/cypress_test/cypress.json
@@ -3,7 +3,6 @@
"video" : false,
"pluginsFile" : "plugins/index.js",
"defaultCommandTimeout" : 6000,
- "supportFile" : "support/index.js",
"ignoreTestFiles" : "*helper.js",
"modifyObstructiveCode": false
}
More information about the Libreoffice-commits
mailing list