Skip to content

Commit

Permalink
Merge pull request #664 from fuweid/fuweid/exit-if-no-gofail
Browse files Browse the repository at this point in the history
*: run test-robustness with build
  • Loading branch information
ahrtr authored Jan 4, 2024
2 parents 25ab4cb + 68ab1a1 commit 2039cee
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 8 deletions.
6 changes: 1 addition & 5 deletions .github/workflows/robustness_template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,4 @@ jobs:
run: |
set -euo pipefail
make gofail-enable
# build bbolt with failpoint
go install ./cmd/bbolt
sudo -E PATH=$PATH make ROBUSTNESS_TESTFLAGS="--count ${{ inputs.count }} --timeout ${{ inputs.testTimeout }} -failfast" test-robustness
ROBUSTNESS_TESTFLAGS="--count ${{ inputs.count }} --timeout ${{ inputs.testTimeout }} -failfast" make test-robustness
15 changes: 12 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,15 @@ coverage:
TEST_FREELIST_TYPE=array go test -v -timeout ${TESTFLAGS_TIMEOUT} \
-coverprofile cover-freelist-array.out -covermode atomic

BOLT_CMD=bbolt

build:
go build -o bin/${BOLT_CMD} ./cmd/${BOLT_CMD}

.PHONY: clean
clean: # Clean binaries
rm -f ./bin/${BOLT_CMD}

.PHONY: gofail-enable
gofail-enable: install-gofail
gofail enable .
Expand All @@ -82,6 +91,6 @@ 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:
go test -v ${TESTFLAGS} ./tests/dmflakey -test.root
go test -v ${TESTFLAGS} ${ROBUSTNESS_TESTFLAGS} ./tests/robustness -test.root
test-robustness: gofail-enable build
sudo env PATH=$$PATH go test -v ${TESTFLAGS} ./tests/dmflakey -test.root
sudo env PATH=$(PWD)/bin:$$PATH go test -v ${TESTFLAGS} ${ROBUSTNESS_TESTFLAGS} ./tests/robustness -test.root

0 comments on commit 2039cee

Please sign in to comment.