cypress: introduce a second chance for the tests to pass.

In parallel build try to run the specific test files
for a second time if they fail. Let's be realist,
testing an online application always has some
unreliabilities, let's make things more reliable with
running test more times and abort the build only if
the test fails consistently.

This is enabled only for parallel builds now, so we
have it on Jenkins. A simple make check will be more
deterministic. I also added an option to disable second
chance for parallel build: see CYPRESS_NO_SECOND_CHANCE
make file variable.

Change-Id: Ib7c554a238ded7ee15908b9f0c2d2c92ef0dcf32
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/91987
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-04-09 16:05:41 +02:00
parent 22f8e63beb
commit b394c5a8f7

View File

@ -209,6 +209,13 @@ define execute_run_parallel
echo "`echo $(1) && $(1)`" > $(2) 2>&1 && \
if [ -z `grep -o -m 1 "Error:" $(2)` ];\
then cat $(2);\
elif [ -z $(CYPRESS_NO_SECOND_CHANCE) ]; \
then echo "Second chance!" > $(2) && \
echo "`echo $(1) && $(1)`" >> $(2) 2>&1 && \
if [ -z `grep -o -m 1 "Error:" $(2)` ];\
then cat $(2);\
else cat $(2) >> $(ERROR_LOG); \
fi;\
else cat $(2) >> $(ERROR_LOG);\
fi;
endef