Skip to content

Commit ddaef08

Browse files
committed
set pipefail option when running tests
When running the tests in CI, we're piping the output of `go test` into gotestfmt to get prettier output. This works because `gotestfmt` will return a non-zero exit code when there are test failures. However when there are other failures, e.g. compilation of the tests failed, `gotestfmt` will have a 0 exit code. `go test` wouldn't, but because we're piping the results through, the shell swallows that unless we're setting the pipefail option. Set up the pipefail option here, so tests aren't accidentally green when compilation fails.
1 parent 8fbc061 commit ddaef08

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Makefile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,15 @@ lint:
1313
tslint -c tslint.json **/*.ts
1414

1515
only_test:
16-
cd misc/test && go test -json ./... --timeout 4h -v -count=1 -short -parallel 40 --tags=all | gotestfmt
16+
set -o pipefail && cd misc/test && go test -json ./... --timeout 4h -v -count=1 -short -parallel 40 --tags=all | gotestfmt
1717

1818
specific_test_set:
1919
echo "running $(TestSet) Acceptance Tests"
20-
cd misc/test && go test -json . --timeout 4h -v -count=1 -short -parallel 40 --tags=all --run=TestAcc$(TestSet) | gotestfmt
20+
set -o pipefail && cd misc/test && go test -json . --timeout 4h -v -count=1 -short -parallel 40 --tags=all --run=TestAcc$(TestSet) | gotestfmt
2121

2222
specific_tag_set:
2323
echo "running $(TagSet)$(TestSet) Acceptance Tests"
24-
cd misc/test && go test -json . --timeout 4h -v -count=1 -short -parallel 40 --tags=$(TagSet) --run=TestAcc$(TagSet)$(TestSet) | gotestfmt
24+
set -o pipefail && cd misc/test && go test -json . --timeout 4h -v -count=1 -short -parallel 40 --tags=$(TagSet) --run=TestAcc$(TagSet)$(TestSet) | gotestfmt
2525

2626
performance_test_set:
2727
cd misc/test && go test . --timeout 4h -count=1 -short -parallel 40 --tags=Performance

0 commit comments

Comments
 (0)