Skip to content

Commit

Permalink
.github: enable failpoints for integration tests
Browse files Browse the repository at this point in the history
And introduce helper to toggle failpoints by makefile.

Signed-off-by: Wei Fu <[email protected]>
  • Loading branch information
fuweid committed Apr 4, 2024
1 parent ef2805f commit 609be39
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 3 deletions.
9 changes: 6 additions & 3 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,16 @@ jobs:
GOARCH=amd64 PASSES='fmt bom dep' ./test
;;
linux-amd64-integration-1-cpu)
GOARCH=amd64 CPU=1 RACE='false' make test-integration
make install-gofail
GOARCH=amd64 CPU=1 RACE='false' FAILPOINTS='true' make test-integration
;;
linux-amd64-integration-2-cpu)
GOARCH=amd64 CPU=2 RACE='false' make test-integration
make install-gofail
GOARCH=amd64 CPU=2 RACE='false' FAILPOINTS='true' make test-integration
;;
linux-amd64-integration-4-cpu)
GOARCH=amd64 CPU=4 RACE='false' make test-integration
make install-gofail
GOARCH=amd64 CPU=4 RACE='false' FAILPOINTS='true' make test-integration
;;
linux-amd64-functional)
./build && GOARCH=amd64 PASSES='functional' ./test
Expand Down
9 changes: 9 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -538,3 +538,12 @@ GOFAIL_VERSION = $(shell cd tools/mod && go list -m -f {{.Version}} go.etcd.io/g
.PHONY: install-gofail
install-gofail:
go install go.etcd.io/gofail@${GOFAIL_VERSION}


.PHONY: gofail-enable
gofail-enable: install-gofail
PASSES="toggle_failpoints" FAILPOINTS=true ./test

.PHONY: gofail-disable
gofail-disable: install-gofail
PASSES="toggle_failpoints" ./test
4 changes: 4 additions & 0 deletions test
Original file line number Diff line number Diff line change
Expand Up @@ -690,6 +690,10 @@ function build_cov_pass {
go test -tags cov -c -covermode=set -coverpkg="$PKGS_COMMA" -o "${out}/etcdctl_test" "${REPO_PATH}/etcdctl"
}

function toggle_failpoints_pass {
toggle_failpoints_default
}

# fail fast on static tests
function build_pass {
echo "Checking build..."
Expand Down

0 comments on commit 609be39

Please sign in to comment.