Skip to content

Commit

Permalink
Merge pull request #368 from zebrunner/develop
Browse files Browse the repository at this point in the history
2.0.15 rc
  • Loading branch information
vdelendik authored Mar 19, 2024
2 parents a611e12 + bc28c2e commit 8cdd8d6
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 25 deletions.
2 changes: 1 addition & 1 deletion Dockerfile-opencv
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM public.ecr.aws/zebrunner/appium:2.0.13
FROM public.ecr.aws/zebrunner/appium:2.0.15

ENV APPIUM_PLUGINS=images

Expand Down
13 changes: 8 additions & 5 deletions device_connect.sh
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -36,7 +39,6 @@ if [[ "$PLATFORM_NAME" == "ios" ]]; then
exit 1
fi

# exit 0 means all good
exit 0
fi

Expand Down Expand Up @@ -86,9 +88,6 @@ do
echo state: $state
echo

# exit with code 1 make container quit without restarting
# exit with code 2 init device reconnect using usbreset

#TODO: let's test release completely without usbreset binary usage
case $state in
"device")
Expand All @@ -105,9 +104,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."
usbreset "${DEVICE_BUS}"
;;
*)
# it should cover such state as: host, recovery, rescue, sideload, no permissions
echo "Troubleshoot device manually to define the best strategy."
Expand Down
20 changes: 1 addition & 19 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down Expand Up @@ -279,15 +279,6 @@ 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
}

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
Expand All @@ -305,12 +296,6 @@ fi
${ENTRYPOINT_DIR}/device_connect.sh

ret=$?
if [ $ret -eq 2 ]; then
echo "Restarting..."
reconnect
exit 1
fi

if [ $ret -eq 1 ]; then
echo "Exiting without restarting..."
exit 0
Expand Down Expand Up @@ -355,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 &
Expand Down

0 comments on commit 8cdd8d6

Please sign in to comment.