git.delta.rocks / unique-network / refs/commits / 724706b2cbb8

difftreelog

ci wait for try-runtime logs (#960)

BuddyGlas2023-07-11parent: #28d97ca.patch.diff
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

modified.github/workflows/try-runtime.ymldiffbeforeafterboth
117 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 on
120 runs-on: [self-hosted-ci]120 runs-on: [medium]
121121
122 timeout-minutes: 600122 timeout-minutes: 600
123123
186 - name: Build the stack186 - name: Build the stack
187 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 300
188
189 - name: Check if docker logs consist logs related to Runtime Upgrade testing.
190 if: success()
191 run: |
192 counter=300
193 counter_life=0
194 function check_container_status {
195 docker inspect -f {{.State.Running}} try-runtime
196 }
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" ]; then
202 echo "Container: try-runtime RUNNING";
203 echo "Check Docker logs"
204 DOCKER_LOGS=$(do_docker_logs)
205 if [[ -n ${DOCKER_LOGS} ]]; then
206 echo "TryRuntime_on_runtime_upgrade executed without errors."
207 return 0
208 else
209 echo "Message not found in logs output, repeating..."
210 return 1
211 fi
212 else
213 DOCKER_LOGS=$(do_docker_logs)
214 while [ $counter_life -lt 3 ]
215 do
216 (( counter_life++ ))
217 if [[ -n ${DOCKER_LOGS} ]]; then
218 echo "TryRuntime_on_runtime_upgrade executed without errors"
219 return 0
220 else
221 echo "Container try-runtime not RUNNING"
222 return 1
223 fi
224 done
225 fi
226 exit 0
227 }
228
229 while ! is_started; do
230 echo "Waiting for special message in log files "
231 sleep 30s
232 counter=$(( $counter - 1 ))
233 echo "Counter: $counter"
234 if [ "$counter" -gt "0" ]; then
235 continue
236 else
237 echo "Counter reached zero, yet upgrade is not finished"
238 exit 1
239 fi
240 done
241 echo "Halting script"
242 exit 0
243 shell: bash
188244
189 - name: Collect Docker Logs245 - name: Collect Docker Logs
190 if: success() || failure()246 if: success() || failure()
193 dest: './try-runtime-logs.${{ matrix.network }}'249 dest: './try-runtime-logs.${{ matrix.network }}'
194250
195 - name: Show docker logs251 - name: Show docker logs
252 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'
197254
198 - name: Stop running containers255 - name: Stop running containers