From 1aa4fc5949a1cadc387380ce72f4444156086447 Mon Sep 17 00:00:00 2001 From: mmetc <92726601+mmetc@users.noreply.github.com> Date: Tue, 28 Nov 2023 17:10:44 +0100 Subject: [PATCH] CI: avoid pipe in makefile, correctly report error in CI when tests fail (#2621) so we don't assume bash+pipefail for the makefile --- .github/workflows/go-tests.yml | 5 +++-- Makefile | 3 +-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/go-tests.yml b/.github/workflows/go-tests.yml index 599285a63..b55431e14 100644 --- a/.github/workflows/go-tests.yml +++ b/.github/workflows/go-tests.yml @@ -140,12 +140,13 @@ jobs: go install github.com/kyoh86/richgo@v0.3.10 set -o pipefail make build BUILD_STATIC=1 - make go-acc | richgo testfilter + make go-acc | sed 's/ *coverage:.*of statements in.*//' | richgo testfilter - name: Run tests again, dynamic run: | make clean build - make go-acc | richgo testfilter + set -o pipefail + make go-acc | sed 's/ *coverage:.*of statements in.*//' | richgo testfilter - name: Upload unit coverage to Codecov uses: codecov/codecov-action@v3 diff --git a/Makefile b/Makefile index c54f647cd..da384923d 100644 --- a/Makefile +++ b/Makefile @@ -232,8 +232,7 @@ test: testenv goversion # run the tests with localstack and coverage .PHONY: go-acc go-acc: testenv goversion - go-acc ./... -o coverage.out --ignore database,notifications,protobufs,cwversion,cstest,models -- $(LD_OPTS) | \ - sed 's/ *coverage:.*of statements in.*//' + go-acc ./... -o coverage.out --ignore database,notifications,protobufs,cwversion,cstest,models -- $(LD_OPTS) # mock AWS services .PHONY: localstack