[Libreoffice-commits] online.git: cypress_test/integration_tests cypress_test/Makefile.am test/Makefile.am test/UnitPHPProxy.cpp

Tamás Zolnai (via logerrit) logerrit at kemper.freedesktop.org
Wed Sep 9 13:50:54 UTC 2020


 cypress_test/Makefile.am                        |   16 ++++++++++++++
 cypress_test/integration_tests/common/helper.js |   26 +++++++++++++-----------
 test/Makefile.am                                |    1 
 test/UnitPHPProxy.cpp                           |    2 -
 4 files changed, 32 insertions(+), 13 deletions(-)

New commits:
commit 0d7a58aa5765a9c997a6ad3e4b77863ed5a29176
Author:     Tamás Zolnai <tamas.zolnai at collabora.com>
AuthorDate: Tue Sep 1 14:57:36 2020 +0200
Commit:     Tamás Zolnai <tamas.zolnai at collabora.com>
CommitDate: Wed Sep 9 15:50:35 2020 +0200

    cypress: add 'make check-proxy-mobile' command.
    
    To run mobile test with php-proxy simulation.
    It's an initial command, should be improved later,
    after php proxy simulation nicely works with the
    tests.
    
    Change-Id: Id9d2bacfbf09ca34a2c84e0d32808749df4c1909
    Reviewed-on: https://gerrit.libreoffice.org/c/online/+/102321
    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 16bbc28c4..78ab24784 100644
--- a/cypress_test/Makefile.am
+++ b/cypress_test/Makefile.am
@@ -205,6 +205,22 @@ do-run-cov: @JAILS_PATH@ $(NODE_BINS)
 	$(call run_all_multiuser_tests,COVERAGE_RUN="1")
 	@$(KILL_COMMAND) || true
 
+check-proxy-mobile: @JAILS_PATH@ $(NODE_BINS)
+	$(call run_JS_error_check)
+	$(eval FREE_PORT:=9979)
+	@pkill loolwsd || pkill --signal SIGKILL loolwsd || true
+	@sleep 5
+	../test/run_unit.sh \
+		--test-name unit-php-proxy.la \
+		--log-file workdir/php-proxy.log \
+		--trs-file workdir/php-proxy.trs \
+		--color-tests yes \
+		--enable-hard-errors yes \
+		--expect-failure no -- ../test/unit-php-proxy.la &
+	@$(WAIT_ON_BINARY) http://localhost:$(FREE_PORT) --timeout 60000
+	$(call run_mobile_tests,$(spec))
+	@pkill loolwsd || pkill --signal SIGKILL loolwsd || true
+
 @JAILS_PATH@:
 	mkdir -p $@
 
diff --git a/cypress_test/integration_tests/common/helper.js b/cypress_test/integration_tests/common/helper.js
index 8113ee55e..f461f90cc 100644
--- a/cypress_test/integration_tests/common/helper.js
+++ b/cypress_test/integration_tests/common/helper.js
@@ -188,17 +188,21 @@ function afterAll(fileName) {
 			Cypress.env('SERVER_PORT') +
 			'/loleaflet/dist/admin/admin.html');
 
-	cy.get('#uptime')
-		.should('not.have.text', '0');
-
-	// We have all lines of document infos as one long string.
-	// We have PID number before the file names, with matching
-	// also on the PID number we can make sure to match on the
-	// whole file name, not on a suffix of a file name.
-	var regex = new RegExp('[0-9]' + fileName);
-	cy.get('#docview', { timeout: Cypress.config('defaultCommandTimeout') * 2.0 })
-		.invoke('text')
-		.should('not.match', regex);
+	if (Cypress.env('SERVER_PORT') === 9979) {
+		cy.wait(5000);
+	} else {
+		cy.get('#uptime')
+			.should('not.have.text', '0');
+
+		// We have all lines of document infos as one long string.
+		// We have PID number before the file names, with matching
+		// also on the PID number we can make sure to match on the
+		// whole file name, not on a suffix of a file name.
+		var regex = new RegExp('[0-9]' + fileName);
+		cy.get('#docview', { timeout: Cypress.config('defaultCommandTimeout') * 2.0 })
+			.invoke('text')
+			.should('not.match', regex);
+	}
 
 	cy.log('Waiting for closing the document - end.');
 }
diff --git a/test/Makefile.am b/test/Makefile.am
index 899dd0764..967143b3e 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -228,7 +228,6 @@ TESTS = \
 	unit-load.la \
 	unit-cursor.la \
 	unit-calc.la \
-	unit-php-proxy.la \
 	unit-insert-delete.la \
 	unit-close.la \
 	unit-bad-doc-load.la \
diff --git a/test/UnitPHPProxy.cpp b/test/UnitPHPProxy.cpp
index 57c44ac30..b3154415e 100644
--- a/test/UnitPHPProxy.cpp
+++ b/test/UnitPHPProxy.cpp
@@ -248,7 +248,7 @@ public:
 
             lastRequestMS = Util::getNowInMS();
             int64_t diff = 0;
-            while (diff < 15000)
+            while (diff < 600000)
             {
                 auto nowMS = Util::getNowInMS();
                 diff = nowMS - lastRequestMS;


More information about the Libreoffice-commits mailing list