Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Catch unit test failures in
make test
(cadence-workflow#5635)
Surprisingly, this has not worked since tests were introduced to the makefile _in 2017_. We've apparently been relying on CI's grepping for go test failure lines or something. Rather trivially, without `-o pipefail` this only returns error messages from `tee`: ```bash > false | tee -a file.log > echo $? 0 ``` Which means this also does not return `exit 1`: ```bash for ... do go test whatever | tee -a file.log; done ``` Which means you can fail a test and the tests keep going, and it exits 0: ```bash > make test ... FAIL github.com/uber/cadence/common/util 0.245s FAIL ok github.com/uber/cadence/common/locks 0.252s coverage: 93.3% of statements ... > echo $? 0 ``` Which kinda stinks for local development. Failing tests can be hard to spot in the massive output of `V=1`, or dozens of lines off-screen if a lot of successful packages ran afterward. Now this will continue running tests, but will clearly fail with a list of all failed packages: ```bash > make test ... FAIL github.com/uber/cadence/common/util 0.245s FAIL ok github.com/uber/cadence/common/locks 0.252s coverage: 93.3% of statements ... Failed packages: ./common/util make: *** [test] Error 1 > echo $? 1 ``` Which is roughly how `go test ./...` works: it fails but keeps going, and does an `exit 1` if there were failures along the way (though it does not show the list of packages). --- This also removes `bins` as a prerequisite for tests, as: - it's slow and usually not necessary - we now have `make build` which is MUCH more complete - CI does this explicitly anyway, no need to do it more than once.
- Loading branch information