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@gmail.com>
Reviewed-by: Tamás Zolnai <tamas.zolnai@collabora.com>
This commit is contained in:
Tamás Zolnai 2020-09-01 14:57:36 +02:00
parent 1951fdbd42
commit 0d7a58aa57
4 changed files with 31 additions and 12 deletions

View file

@ -205,6 +205,22 @@ do-run-cov: @JAILS_PATH@ $(NODE_BINS)
$(call run_all_multiuser_tests,COVERAGE_RUN="1") $(call run_all_multiuser_tests,COVERAGE_RUN="1")
@$(KILL_COMMAND) || true @$(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@: @JAILS_PATH@:
mkdir -p $@ mkdir -p $@

View file

@ -188,17 +188,21 @@ function afterAll(fileName) {
Cypress.env('SERVER_PORT') + Cypress.env('SERVER_PORT') +
'/loleaflet/dist/admin/admin.html'); '/loleaflet/dist/admin/admin.html');
cy.get('#uptime') if (Cypress.env('SERVER_PORT') === 9979) {
.should('not.have.text', '0'); 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 all lines of document infos as one long string.
// We have PID number before the file names, with matching // We have PID number before the file names, with matching
// also on the PID number we can make sure to match on the // also on the PID number we can make sure to match on the
// whole file name, not on a suffix of a file name. // whole file name, not on a suffix of a file name.
var regex = new RegExp('[0-9]' + fileName); var regex = new RegExp('[0-9]' + fileName);
cy.get('#docview', { timeout: Cypress.config('defaultCommandTimeout') * 2.0 }) cy.get('#docview', { timeout: Cypress.config('defaultCommandTimeout') * 2.0 })
.invoke('text') .invoke('text')
.should('not.match', regex); .should('not.match', regex);
}
cy.log('Waiting for closing the document - end.'); cy.log('Waiting for closing the document - end.');
} }

View file

@ -228,7 +228,6 @@ TESTS = \
unit-load.la \ unit-load.la \
unit-cursor.la \ unit-cursor.la \
unit-calc.la \ unit-calc.la \
unit-php-proxy.la \
unit-insert-delete.la \ unit-insert-delete.la \
unit-close.la \ unit-close.la \
unit-bad-doc-load.la \ unit-bad-doc-load.la \

View file

@ -248,7 +248,7 @@ public:
lastRequestMS = Util::getNowInMS(); lastRequestMS = Util::getNowInMS();
int64_t diff = 0; int64_t diff = 0;
while (diff < 15000) while (diff < 600000)
{ {
auto nowMS = Util::getNowInMS(); auto nowMS = Util::getNowInMS();
diff = nowMS - lastRequestMS; diff = nowMS - lastRequestMS;