difftreelog
ci wait for try-runtime logs (#960)
in: master
* test try-runtime 01 * test try-runtime 02 * test try-runtime 03 * test try-runtime 04 * test try-runtime 05 * test try-runtime * test try-runtime 6 * test 7 * test try-runtime 8 * test try-runtime 9 * test try-runtime 10
1 file changed
.github/workflows/try-runtime.ymldiffbeforeafterboth117 try-runtime-tests:117 try-runtime-tests:118 needs: [prepare-execution-marix, try-runtime-build]118 needs: [prepare-execution-marix, try-runtime-build]119 # The type of runner that the job will run on119 # The type of runner that the job will run on120 runs-on: [self-hosted-ci]120 runs-on: [medium]121121122 timeout-minutes: 600122 timeout-minutes: 600123123186 - name: Build the stack186 - name: Build the stack187 run: docker-compose -f ".docker/docker-compose.try-runtime.${{ matrix.network }}.yml" up -d --remove-orphans --force-recreate --timeout 300187 run: docker-compose -f ".docker/docker-compose.try-runtime.${{ matrix.network }}.yml" up -d --remove-orphans --force-recreate --timeout 300188189 - name: Check if docker logs consist logs related to Runtime Upgrade testing.190 if: success()191 run: |192 counter=300193 counter_life=0194 function check_container_status {195 docker inspect -f {{.State.Running}} try-runtime196 }197 function do_docker_logs {198 docker logs --details try-runtime 2>&1 | grep -i 'TryRuntime_on_runtime_upgrade executed without errors. Consumed'199 }200 function is_started {201 if [ "$(check_container_status)" == "true" ]; then202 echo "Container: try-runtime RUNNING";203 echo "Check Docker logs"204 DOCKER_LOGS=$(do_docker_logs)205 if [[ -n ${DOCKER_LOGS} ]]; then206 echo "TryRuntime_on_runtime_upgrade executed without errors."207 return 0208 else209 echo "Message not found in logs output, repeating..."210 return 1211 fi212 else213 DOCKER_LOGS=$(do_docker_logs)214 while [ $counter_life -lt 3 ] 215 do216 (( counter_life++ ))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 1223 fi224 done225 fi226 exit 0227 }228229 while ! is_started; do230 echo "Waiting for special message in log files "231 sleep 30s232 counter=$(( $counter - 1 ))233 echo "Counter: $counter"234 if [ "$counter" -gt "0" ]; then235 continue236 else237 echo "Counter reached zero, yet upgrade is not finished"238 exit 1239 fi240 done241 echo "Halting script"242 exit 0243 shell: bash188244189 - name: Collect Docker Logs245 - name: Collect Docker Logs190 if: success() || failure()246 if: success() || failure()193 dest: './try-runtime-logs.${{ matrix.network }}'249 dest: './try-runtime-logs.${{ matrix.network }}'194250195 - name: Show docker logs251 - name: Show docker logs252 if: success() || failure()196 run: cat './try-runtime-logs.${{ matrix.network }}/try-runtime.log'253 run: cat './try-runtime-logs.${{ matrix.network }}/try-runtime.log'197254198 - name: Stop running containers255 - name: Stop running containers