fix(ci): validate tests exit code after reading the container logs (#3968)

* fix(ci): validate exit code

* fix(ci): use a single step

* fix: run from gcp command

* fix: remove variable substitution

* fix: escaping characters

* fix: handle bash issues with variable expansion

* fix: seggregate execution into multiple steps

* fix: the command is a string

* fix: move docker ignore to use caching

* revert panic

* fix: add panic and fix exit code command

* revert: remove panic

* fix: apply the exit code to all gcp tests

* imp(ci): use single line exit

* Clean up the CODEOWNERS file

We moved the dockerignore file into the docker directory,
so it doesn't need a separate entry any more.

Co-authored-by: teor <teor@riseup.net>
This commit is contained in:
Gustavo Valverde 2022-04-07 19:16:40 -04:00 committed by GitHub
parent 6fada06d20
commit 44cb35c320
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 32 additions and 3 deletions

1
.github/CODEOWNERS vendored
View File

@ -39,7 +39,6 @@
/docker/ @ZcashFoundation/devops-reviewers
cloudbuild.yaml @ZcashFoundation/devops-reviewers
codecov.yml @ZcashFoundation/devops-reviewers
.dockerignore @ZcashFoundation/devops-reviewers
firebase.json @ZcashFoundation/devops-reviewers
katex-header.html @ZcashFoundation/devops-reviewers

View File

@ -221,6 +221,16 @@ jobs:
--ssh-flag="-o ServerAliveInterval=5" \
--command="docker logs --follow ${{ env.CONTAINER_NAME }}"
EXIT_CODE=$(\
gcloud compute ssh \
sync-checkpoint-${{ env.GITHUB_REF_SLUG_URL }}-${{ env.GITHUB_SHA_SHORT }} \
--zone ${{ env.ZONE }} \
--quiet \
--ssh-flag="-o ServerAliveInterval=5" \
--command="docker wait ${{ env.CONTAINER_NAME }}")
exit ${EXIT_CODE}
- name: Get sync height from logs
run: |
SYNC_HEIGHT=""

View File

@ -311,7 +311,7 @@ jobs:
echo "::set-output name=zebra_container::$CONTAINER_NAME"
sleep 60
- name: Regenerate stateful disks logs
- name: Regenerate stateful disks
id: sync-to-checkpoint
if: ${{ steps.create-instance.outcome == 'success' }}
run: |
@ -321,6 +321,16 @@ jobs:
--quiet \
--ssh-flag="-o ServerAliveInterval=5" \
--command="docker logs --follow ${{ env.ZEBRA_CONTAINER }}"
EXIT_CODE=$(\
gcloud compute ssh \
sync-checkpoint-${{ env.GITHUB_REF_SLUG_URL }}-${{ env.GITHUB_SHA_SHORT }} \
--zone ${{ env.ZONE }} \
--quiet \
--ssh-flag="-o ServerAliveInterval=5" \
--command="docker wait ${{ env.ZEBRA_CONTAINER }}")
exit ${EXIT_CODE}
env:
ZEBRA_CONTAINER: ${{ steps.get-container-name.outputs.zebra_container }}
@ -442,7 +452,7 @@ jobs:
echo "::set-output name=zebra_container::$CONTAINER_NAME"
sleep 60
- name: Sync past mandatory checkpoint logs
- name: Sync past mandatory checkpoint
id: sync-past-checkpoint
run: |
gcloud compute ssh \
@ -451,6 +461,16 @@ jobs:
--quiet \
--ssh-flag="-o ServerAliveInterval=5" \
--command="docker logs --follow ${{ env.ZEBRA_CONTAINER }}"
EXIT_CODE=$(\
gcloud compute ssh \
sync-checkpoint-${{ env.GITHUB_REF_SLUG_URL }}-${{ env.GITHUB_SHA_SHORT }} \
--zone ${{ env.ZONE }} \
--quiet \
--ssh-flag="-o ServerAliveInterval=5" \
--command="docker wait ${{ env.ZEBRA_CONTAINER }}")
exit ${EXIT_CODE}
env:
ZEBRA_CONTAINER: ${{ steps.get-container-name.outputs.zebra_container }}