Skip to content

Commit

Permalink
Fix failure when there are go test issues that do not create -json lo…
Browse files Browse the repository at this point in the history
…gs (#725)

- metrics collection failure should not fail pipeline
- when go test fails, its exit code should fail the step when it pipes its output to other tools
  • Loading branch information
tateexon authored May 28, 2024
1 parent 88d0b37 commit cc8b3dd
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion .github/workflows/relay.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ jobs:
hostname: ${{ secrets.GRAFANA_INTERNAL_HOST }}
this-job-name: Relay Run Unit Tests
test-results-file: '{"testType":"go","filePath":"/tmp/gotest.log"}'
continue-on-error: true
- name: Checkout sources
uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b # v4.1.5
- name: Setup go
Expand All @@ -42,7 +43,9 @@ jobs:
- name: Build
run: go build -v ./pkg/...
- name: Test
run: go test ./pkg/... -json -tags integration -covermode=atomic -coverpkg=./... -coverprofile=integration_coverage.txt 2>&1 | tee /tmp/gotest.log | gotestloghelper -ci
run: |
set -o pipefail
go test ./pkg/... -json -tags integration -covermode=atomic -coverpkg=./... -coverprofile=integration_coverage.txt 2>&1 | tee /tmp/gotest.log | gotestloghelper -ci
- name: Test with the race detector enabled
run: go test ./pkg/... -v -race -count=10 -timeout=15m -covermode=atomic -coverpkg=./... -coverprofile=race_coverage.txt
- name: Upload Go test results
Expand All @@ -51,5 +54,6 @@ jobs:
with:
name: go-relay-test-results
path: |
/tmp/gotest.log
./race_coverage.txt
./integration_coverage.txt

0 comments on commit cc8b3dd

Please sign in to comment.