From 8bf5f8636b7aab3f0fa55d8fa50b4ed7567857f6 Mon Sep 17 00:00:00 2001 From: vdelendik Date: Fri, 15 Mar 2024 17:38:46 +0000 Subject: [PATCH 1/6] bump up to appium:2.0.14 for opencv --- Dockerfile-opencv | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile-opencv b/Dockerfile-opencv index dae7745..3ea7be4 100644 --- a/Dockerfile-opencv +++ b/Dockerfile-opencv @@ -1,4 +1,4 @@ -FROM public.ecr.aws/zebrunner/appium:2.0.13 +FROM public.ecr.aws/zebrunner/appium:2.0.14 ENV APPIUM_PLUGINS=images From 17efae4559d76e52cdfbecbe309edd6ec8a9cb64 Mon Sep 17 00:00:00 2001 From: azarouski Date: Mon, 18 Mar 2024 14:54:09 +0300 Subject: [PATCH 2/6] new state was added --- device_connect.sh | 6 +++++- entrypoint.sh | 7 ++----- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/device_connect.sh b/device_connect.sh index c5e723d..f135bf9 100755 --- a/device_connect.sh +++ b/device_connect.sh @@ -105,9 +105,13 @@ do exit 1 ;; *"offline"*) - # try to reconnect right here + echo "Device is offline, performing adb reconnect." adb reconnect ;; + *"no devices/emulators found"*) + echo "Device not found, performing usb port reset." + exit 2 + ;; *) # it should cover such state as: host, recovery, rescue, sideload, no permissions echo "Troubleshoot device manually to define the best strategy." diff --git a/entrypoint.sh b/entrypoint.sh index cab958a..0559254 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -281,11 +281,8 @@ capture_video() { reconnect() { - #let's try to do forcibly usbreset on exit when node is crashed/exited/killed - if [ "${PLATFORM_NAME}" == "android" ]; then - echo "Doing usbreset forcibly on attached device" - usbreset ${DEVICE_BUS} - fi + echo "Doing usbreset forcibly on attached device ${DEVICE_BUS}" + usbreset "${DEVICE_BUS}" } if [ ! -z "${SALT_MASTER}" ]; then From 7185d2a59a726c6f5cc841b451b9eac40cc0d523 Mon Sep 17 00:00:00 2001 From: azarouski Date: Mon, 18 Mar 2024 15:24:37 +0300 Subject: [PATCH 3/6] #327 reconnect method was deleted usbreset call was moved to device_connect.sh --- device_connect.sh | 3 ++- entrypoint.sh | 7 ------- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/device_connect.sh b/device_connect.sh index f135bf9..61ceaed 100755 --- a/device_connect.sh +++ b/device_connect.sh @@ -87,7 +87,7 @@ do echo # exit with code 1 make container quit without restarting - # exit with code 2 init device reconnect using usbreset + # exit with code 2 make container restart #TODO: let's test release completely without usbreset binary usage case $state in @@ -110,6 +110,7 @@ do ;; *"no devices/emulators found"*) echo "Device not found, performing usb port reset." + usbreset "${DEVICE_BUS}" exit 2 ;; *) diff --git a/entrypoint.sh b/entrypoint.sh index 0559254..3b7822f 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -279,12 +279,6 @@ capture_video() { } - -reconnect() { - echo "Doing usbreset forcibly on attached device ${DEVICE_BUS}" - usbreset "${DEVICE_BUS}" -} - if [ ! -z "${SALT_MASTER}" ]; then echo "[INIT] ENV SALT_MASTER it not empty, salt-minion will be prepared" echo "master: ${SALT_MASTER}" >> /etc/salt/minion @@ -304,7 +298,6 @@ ${ENTRYPOINT_DIR}/device_connect.sh ret=$? if [ $ret -eq 2 ]; then echo "Restarting..." - reconnect exit 1 fi From 25a3330968fbb293925ec95702556682fae1d9ec Mon Sep 17 00:00:00 2001 From: azarouski Date: Mon, 18 Mar 2024 15:55:48 +0300 Subject: [PATCH 4/6] #327: `exit 2` was removed from device_connect.sh some comments were edited --- device_connect.sh | 8 +++----- entrypoint.sh | 5 ----- 2 files changed, 3 insertions(+), 10 deletions(-) diff --git a/device_connect.sh b/device_connect.sh index 61ceaed..247b4a9 100755 --- a/device_connect.sh +++ b/device_connect.sh @@ -1,5 +1,8 @@ #!/bin/bash +# exit with code 1 make container quit without restarting +# exit with code 0 means all good + # convert to lower case using Linux/Mac compatible syntax (bash v3.2) PLATFORM_NAME=`echo "$PLATFORM_NAME" | tr '[:upper:]' '[:lower:]'` if [[ "$PLATFORM_NAME" == "ios" ]]; then @@ -36,7 +39,6 @@ if [[ "$PLATFORM_NAME" == "ios" ]]; then exit 1 fi - # exit 0 means all good exit 0 fi @@ -86,9 +88,6 @@ do echo state: $state echo - # exit with code 1 make container quit without restarting - # exit with code 2 make container restart - #TODO: let's test release completely without usbreset binary usage case $state in "device") @@ -111,7 +110,6 @@ do *"no devices/emulators found"*) echo "Device not found, performing usb port reset." usbreset "${DEVICE_BUS}" - exit 2 ;; *) # it should cover such state as: host, recovery, rescue, sideload, no permissions diff --git a/entrypoint.sh b/entrypoint.sh index 3b7822f..a5f3d66 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -296,11 +296,6 @@ fi ${ENTRYPOINT_DIR}/device_connect.sh ret=$? -if [ $ret -eq 2 ]; then - echo "Restarting..." - exit 1 -fi - if [ $ret -eq 1 ]; then echo "Exiting without restarting..." exit 0 From 4ec7c5b2b3091ca6d2b8a635a9dad1fd29c8decd Mon Sep 17 00:00:00 2001 From: azarouski Date: Mon, 18 Mar 2024 17:24:03 +0300 Subject: [PATCH 5/6] #353: xvfb-run was removed --- entrypoint.sh | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/entrypoint.sh b/entrypoint.sh index a5f3d66..97d1d4e 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -14,7 +14,7 @@ if [[ -n $APPIUM_PLUGINS ]]; then echo "plugins_cli: $plugins_cli" fi -CMD="xvfb-run appium --log-no-colors --log-timestamp -pa /wd/hub --port $APPIUM_PORT --log $TASK_LOG --log-level $LOG_LEVEL $APPIUM_CLI $plugins_cli" +CMD="appium --log-no-colors --log-timestamp -pa /wd/hub --port $APPIUM_PORT --log $TASK_LOG --log-level $LOG_LEVEL $APPIUM_CLI $plugins_cli" #--use-plugins=relaxed-caps share() { @@ -340,9 +340,6 @@ if [ "$ADB_SHELL" = true ]; then CMD+=" --allow-insecure adb_shell" fi -pkill -x xvfb-run -rm -rf /tmp/.X99-lock - touch ${TASK_LOG} echo $CMD $CMD & From bc28c2ebb180968dff9a677c897275e346767eaf Mon Sep 17 00:00:00 2001 From: vdelendik Date: Tue, 19 Mar 2024 16:39:19 +0000 Subject: [PATCH 6/6] bump up opencv to appium:2.0.15 --- Dockerfile-opencv | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile-opencv b/Dockerfile-opencv index 3ea7be4..8ec7d7f 100644 --- a/Dockerfile-opencv +++ b/Dockerfile-opencv @@ -1,4 +1,4 @@ -FROM public.ecr.aws/zebrunner/appium:2.0.14 +FROM public.ecr.aws/zebrunner/appium:2.0.15 ENV APPIUM_PLUGINS=images