Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(ci): do not keep logging if grep times out or finds the string #7722

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 6 additions & 7 deletions .github/workflows/deploy-gcp-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -595,11 +595,14 @@ jobs:
# lines before the startup logs. So that's what we use here.
#
# The log pipeline ignores the exit status of `docker logs`.
# It also ignores the expected 'broken pipe' error from `tee`,
# which happens when `grep` finds a matching output and moves on to the next job.
#
# We're using >(...) which is a form of process substitution in Bash.
# The advantage of this method is that it avoids the "broken pipe" error
# as the `tee` command isn't directly writing to a closed pipe.
#
# Errors in the tests are caught by the final test status job.
- name: Check startup logs for ${{ inputs.test_id }}
timeout-minutes: 5
shell: /usr/bin/bash -exo pipefail {0}
run: |
gcloud compute ssh ${{ inputs.test_id }}-${{ env.GITHUB_REF_SLUG_URL }}-${{ env.GITHUB_SHA_SHORT }} \
Expand All @@ -615,11 +618,7 @@ jobs:
sudo docker logs \
--tail all \
--follow \
${{ inputs.test_id }} | \
head -700 | \
tee --output-error=exit-nopipe /dev/stderr | \
grep --max-count=1 --extended-regexp --color=always \
"Zcash network: ${{ inputs.network }}"; \
${{ inputs.test_id }} > >(head -700 | tee /dev/stderr | grep --max-count=1 --extended-regexp --color=always "Zcash network: ${{ inputs.network }}");
'

# Check that the container executed at least 1 Rust test harness test, and that all tests passed.
Expand Down
Loading