Skip to content

Commit

Permalink
test-robustness: fail if bbolt didn't enable gofail
Browse files Browse the repository at this point in the history
Signed-off-by: Wei Fu <fuweid89@gmail.com>
  • Loading branch information
fuweid committed Jan 4, 2024
1 parent 19be273 commit 4c31312
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,15 @@ test-failpoint:
BBOLT_VERIFY=all TEST_FREELIST_TYPE=array go test -v ${TESTFLAGS} -timeout 30m ./tests/failpoint

.PHONY: test-robustness # Running robustness tests requires root permission
test-robustness:
test-robustness: check-gofail
go test -v ${TESTFLAGS} ./tests/dmflakey -test.root
go test -v ${TESTFLAGS} ${ROBUSTNESS_TESTFLAGS} ./tests/robustness -test.root

.PHONY: check-gofail
check-gofail: # Returns fail if binaries aren't built with gofail
@(for binary_name in bbolt; do \
export BINARY_PATH=`command -v $$binary_name`; \
go version -m $$BINARY_PATH | grep -q go.etcd.io/gofail && continue; \
sh -c "echo $$BINARY_PATH wasn\'t built with gofail 1>&2"; \
exit 2 ; \
done)

0 comments on commit 4c31312

Please sign in to comment.