Skip to content

Commit

Permalink
*: run test-robustness with build
Browse files Browse the repository at this point in the history
Add new recipe to build bbolt command so that we can ensure that
test-robustness recipe is using bbolt with gofail.

Since test-robustness requires root, move `sudo` into test-robustness
recipe. Otherwise, both bbolt binary and gofail code belongs to root
user.

Signed-off-by: Wei Fu <[email protected]>
  • Loading branch information
fuweid committed Jan 4, 2024
1 parent 25ab4cb commit 68ab1a1
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 68ab1a1

Please sign in to comment.