Skip to content

Commit 5c1b3bd

Browse files
chore: fix suppressed errors from pipe command (GoogleCloudPlatform#125)
1 parent f2529d0 commit 5c1b3bd

File tree

1 file changed

+15
-3
lines changed

1 file changed

+15
-3
lines changed

.github/workflows/tests.yaml

+15-3
Original file line numberDiff line numberDiff line change
@@ -85,11 +85,17 @@ jobs:
8585
ALLOYDB_USER: 'postgres'
8686
ALLOYDB_PASS: '${{ steps.secrets.outputs.ALLOYDB_CLUSTER_PASS }}'
8787
ALLOYDB_CONNECTION_NAME: '${{ steps.secrets.outputs.ALLOYDB_CONN_NAME }}'
88+
# specifying bash shell ensures a failure in a piped process isn't lost by using `set -eo pipefail`
89+
shell: bash
8890
run: |
89-
go install github.com/jstemmer/go-junit-report/v2@latest
9091
go test -v -race -cover ./tests | tee test_results.txt
91-
go-junit-report -in test_results.txt -set-exit-code -out integration_sponge_log.xml
9292
93+
- name: Convert test output to XML
94+
if: ${{ (github.event_name == 'schedule' || github.event_name == 'push') && always() }}
95+
run: |
96+
go install github.com/jstemmer/go-junit-report/v2@latest
97+
go-junit-report -in test_results.txt -set-exit-code -out integration_sponge_log.xml
98+
9399
- name: FlakyBot
94100
# only run flakybot on periodic (schedule) and continuous (push) events
95101
if: ${{ (github.event_name == 'schedule' || github.event_name == 'push') && always() }}
@@ -147,9 +153,15 @@ jobs:
147153
service_account: ${{ secrets.SERVICE_ACCOUNT }}
148154

149155
- name: Run tests
156+
# specifying bash shell ensures a failure in a piped process isn't lost by using `set -eo pipefail`
157+
shell: bash
150158
run: |
151-
go install github.com/jstemmer/go-junit-report/v2@latest
152159
go test -race -v -cover -short ./... | tee test_results.txt
160+
161+
- name: Convert test output to XML
162+
if: ${{ (github.event_name == 'schedule' || github.event_name == 'push') && always() }}
163+
run: |
164+
go install github.com/jstemmer/go-junit-report/v2@latest
153165
go-junit-report -in test_results.txt -set-exit-code -out unit_sponge_log.xml
154166
155167
- name: FlakyBot (Linux)

0 commit comments

Comments
 (0)