zebrunner / mcloud-device

Android, Appium and STF provider in Docker.
10 stars 8 forks source link

provide debug option for the mcloud-device container #135

Closed vdelendik closed 7 months ago

vdelendik commented 1 year ago

in case of any problem we do have device containers in restarting state:

901fc27e483b   public.ecr.aws/zebrunner/mcloud-device:2.4.6   "/bin/sh -c 'bash /o…"   30 hours ago   Restarting (255) 17 seconds ago                                                                                                                                                device-iPhone_12_mini-0..E
bde99e1f3f57   public.ecr.aws/zebrunner/appium:1.4.12-beta2   "/root/entry_point.sh"   30 hours ago   Up 8 seconds (health: starting)    4723/tcp, 0.0.0.0:7741->7741/tcp, :::7741->7741/tcp                                                                                         device-iPhone_12_mini-0..E-appium

let's introduce new DEBUG mode which allow us to stay at the end so user can bash into the container and test all kind of infrastructure settings. Ideally it should be organized via start command argument.

if DEBUG=true we should prohibit exit and restart and stay as is... The same should be implemented for appium container

azarouski commented 7 months ago

To check this enhancement you need to change Dockerfile variables before build:

ENV DEBUG=true
ENV DEBUG_TIMEOUT=3600
ENV VERBOSE=true

or run an already built container with --env args:

docker run -d --env DEBUG=true --env VERBOSE=true ... IMAGE [COMMAND] [ARG...]

after that you need to broke some code to provoke container to exit (in usual situation) and check that container has not exited. Also you need to check logs for verbose output.

dhreben commented 7 months ago

Debug and Verbose mods are present, but we catch log issue /opt/debug.sh: line 12: 3600: command not found

log:

docker run --env DEBUG=true --env VERBOSE=true public.ecr.aws/zebrunner/mcloud-device:2.6.4-beta17
/opt/debug.sh: line 12: 3600: command not found
+ [[ -z '' ]]
+ echo 'Exiting without restart as one of important setting is missed!'
+ exit 0
+ echo 'Exit attempt intercepted. Sleep for 3600 seconds activated!'
+ sleep 3600
#######################################################
#                                                     #
#                  DEBUG mode is on!                  #
#                                                     #
#######################################################
#######################################################
#                                                     #
#                 VERBOSE mode is on!                 #
#                                                     #
#######################################################
Exiting without restart as one of important setting is missed!
Exit attempt intercepted. Sleep for 3600 seconds activated!
azarouski commented 7 months ago

fixed

dhreben commented 7 months ago

Verified. Tested on public.ecr.aws/zebrunner/mcloud-device:2.6.4-beta17