difftreelog
ci(try-runtime) fix false-positive
in: master
1 file changed
.github/workflows/try-runtime.ymldiffbeforeafterboth188188189 - name: Check if docker logs consist logs related to Runtime Upgrade testing.189 - name: Check if docker logs consist logs related to Runtime Upgrade testing.190 if: success()190 if: success()191 run: |191 run: |192 counter=300192 counter=300193 counter_life=0193 counter_life=0194 function check_container_status {194 function check_container_status {195 docker inspect -f {{.State.Running}} try-runtime195 docker inspect -f {{.State.Running}} try-runtime196 }196 }197 function do_docker_logs {197 function do_docker_logs {198 docker logs --details try-runtime 2>&1 | grep -i 'TryRuntime_on_runtime_upgrade executed without errors. Consumed'198 docker logs --details try-runtime 2>&1 | grep -i 'TryRuntime_on_runtime_upgrade executed without errors. Consumed'199 }199 }200 function is_started {200 function is_started {201 if [ "$(check_container_status)" == "true" ]; then201 if [ "$(check_container_status)" == "true" ]; then202 echo "Container: try-runtime RUNNING";202 echo "Container: try-runtime RUNNING";203 echo "Check Docker logs"203 echo "Check Docker logs"204 DOCKER_LOGS=$(do_docker_logs)204 DOCKER_LOGS=$(do_docker_logs)205 if [[ -n ${DOCKER_LOGS} ]]; then205 if [[ -n ${DOCKER_LOGS} ]]; then206 echo "TryRuntime_on_runtime_upgrade executed without errors."206 echo "TryRuntime_on_runtime_upgrade executed without errors."207 return 0207 return 0208 else208 else209 echo "Message not found in logs output, repeating..."209 echo "Message not found in logs output, repeating..."210 return 1210 return 1211 fi211 fi212 else212 else213 DOCKER_LOGS=$(do_docker_logs)213 (( counter_life++ ))214 while [ $counter_life -lt 3 ] 215 do216 (( counter_life++ ))214 echo "Container try-runtime not RUNNING" $counter_life "time"217 if [[ -n ${DOCKER_LOGS} ]]; then218 echo "TryRuntime_on_runtime_upgrade executed without errors"219 return 0220 else221 echo "Container try-runtime not RUNNING"222 return 1215 return 1223 fi216 fi224 done217 }225 fi226 exit 0227 }218228219 while ! is_started; do229 while ! is_started; do220 echo "Waiting for special message in log files "230 echo "Waiting for special message in log files "221 sleep 30s231 sleep 30s222 counter=$(( $counter - 1 ))232 counter=$(( $counter - 1 ))223 echo "Counter: $counter"233 echo "Counter: $counter"224 if [ "$counter" -gt "0" ] && [ "$counter_life" -lt "3" ]; then234 if [ "$counter" -gt "0" ]; then225 continue235 continue226 else236 else227 echo "Counter reached zero, yet upgrade is not finished correctly or Container try-runtime is not RUNNING"237 echo "Counter reached zero, yet upgrade is not finished"228 exit 1238 exit 1229 fi239 fi230 done240 done231 echo "Halting script"241 echo "Halting script"232 exit 0242 exit 0243 shell: bash233 shell: bash244234245 - name: Collect Docker Logs235 - name: Collect Docker Logs