.github: enable failpoints for integration tests

And introduce helper to toggle failpoints by makefile.

Signed-off-by: Wei Fu <fuweid89@gmail.com>
This commit is contained in:
Wei Fu 2024-04-04 15:13:19 +08:00
parent ef2805fb50
commit 609be39ea9
3 changed files with 19 additions and 3 deletions

View File

@ -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

View File

@ -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
test
View File

@ -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..."