-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: wait for try-runtime logs (#960)
* 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
- Loading branch information
Showing
1 changed file
with
58 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -117,7 +117,7 @@ jobs: | |
try-runtime-tests: | ||
needs: [prepare-execution-marix, try-runtime-build] | ||
# The type of runner that the job will run on | ||
runs-on: [self-hosted-ci] | ||
runs-on: [medium] | ||
|
||
timeout-minutes: 600 | ||
|
||
|
@@ -186,13 +186,70 @@ jobs: | |
- name: Build the stack | ||
run: docker-compose -f ".docker/docker-compose.try-runtime.${{ matrix.network }}.yml" up -d --remove-orphans --force-recreate --timeout 300 | ||
|
||
- name: Check if docker logs consist logs related to Runtime Upgrade testing. | ||
if: success() | ||
run: | | ||
counter=300 | ||
counter_life=0 | ||
function check_container_status { | ||
docker inspect -f {{.State.Running}} try-runtime | ||
} | ||
function do_docker_logs { | ||
docker logs --details try-runtime 2>&1 | grep -i 'TryRuntime_on_runtime_upgrade executed without errors. Consumed' | ||
} | ||
function is_started { | ||
if [ "$(check_container_status)" == "true" ]; then | ||
echo "Container: try-runtime RUNNING"; | ||
echo "Check Docker logs" | ||
DOCKER_LOGS=$(do_docker_logs) | ||
if [[ -n ${DOCKER_LOGS} ]]; then | ||
echo "TryRuntime_on_runtime_upgrade executed without errors." | ||
return 0 | ||
else | ||
echo "Message not found in logs output, repeating..." | ||
return 1 | ||
fi | ||
else | ||
DOCKER_LOGS=$(do_docker_logs) | ||
while [ $counter_life -lt 3 ] | ||
do | ||
(( counter_life++ )) | ||
if [[ -n ${DOCKER_LOGS} ]]; then | ||
echo "TryRuntime_on_runtime_upgrade executed without errors" | ||
return 0 | ||
else | ||
echo "Container try-runtime not RUNNING" | ||
return 1 | ||
fi | ||
done | ||
fi | ||
exit 0 | ||
} | ||
while ! is_started; do | ||
echo "Waiting for special message in log files " | ||
sleep 30s | ||
counter=$(( $counter - 1 )) | ||
echo "Counter: $counter" | ||
if [ "$counter" -gt "0" ]; then | ||
continue | ||
else | ||
echo "Counter reached zero, yet upgrade is not finished" | ||
exit 1 | ||
fi | ||
done | ||
echo "Halting script" | ||
exit 0 | ||
shell: bash | ||
|
||
- name: Collect Docker Logs | ||
if: success() || failure() | ||
uses: jwalton/[email protected] | ||
with: | ||
dest: './try-runtime-logs.${{ matrix.network }}' | ||
|
||
- name: Show docker logs | ||
if: success() || failure() | ||
run: cat './try-runtime-logs.${{ matrix.network }}/try-runtime.log' | ||
|
||
- name: Stop running containers | ||
|