Skip to content

Commit

Permalink
Merge pull request etcd-io#16368 from jmhbnz/streamline-test-commands
Browse files Browse the repository at this point in the history
 [3.4] Backport Makefile recipes for common test commands
  • Loading branch information
ahrtr authored Aug 4, 2023
2 parents 08401f8 + 74a148e commit 7655708
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 6 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,19 +38,19 @@ jobs:
GOARCH=amd64 PASSES='fmt bom dep' ./test
;;
linux-amd64-integration-1-cpu)
GOARCH=amd64 CPU=1 PASSES='integration' RACE='false' ./test
GOARCH=amd64 CPU=1 RACE='false' make test-integration
;;
linux-amd64-integration-2-cpu)
GOARCH=amd64 CPU=2 PASSES='integration' RACE='false' ./test
GOARCH=amd64 CPU=2 RACE='false' make test-integration
;;
linux-amd64-integration-4-cpu)
GOARCH=amd64 CPU=4 PASSES='integration' RACE='false' ./test
GOARCH=amd64 CPU=4 RACE='false' make test-integration
;;
linux-amd64-functional)
./build && GOARCH=amd64 PASSES='functional' ./test
;;
linux-amd64-unit-4-cpu-race)
GOARCH=amd64 PASSES='unit' RACE='true' CPU='4' ./test -p=2
GOARCH=amd64 RACE='true' CPU='4' GO_TEST_FLAGS='-p=2' make test-unit
;;
all-build)
GOARCH=amd64 PASSES='build' ./test
Expand All @@ -66,10 +66,10 @@ jobs:
PASSES='build grpcproxy' CPU='4' RACE='true' ./test
;;
linux-amd64-e2e)
GOARCH=amd64 PASSES='build release e2e' ./test
GOARCH=amd64 make test-e2e-release
;;
linux-386-unit)
GOARCH=386 PASSES='unit' ./test
GOARCH=386 make test-unit
;;
*)
echo "Failed to find target"
Expand Down
16 changes: 16 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,22 @@ test:
$(TEST_OPTS) ./test 2>&1 | tee test-$(TEST_SUFFIX).log
! egrep "(--- FAIL:|DATA RACE|panic: test timed out|appears to have leaked)" -B50 -A10 test-$(TEST_SUFFIX).log

.PHONY: test-unit
test-unit:
PASSES="unit" ./test $(GO_TEST_FLAGS)

.PHONY: test-integration
test-integration:
PASSES="integration" ./test $(GO_TEST_FLAGS)

.PHONY: test-e2e
test-e2e:
PASSES="build e2e" ./test $(GO_TEST_FLAGS)

.PHONY: test-e2e-release
test-e2e-release:
PASSES="build release e2e" ./test $(GO_TEST_FLAGS)

docker-test:
$(info GO_VERSION: $(GO_VERSION))
$(info ETCD_VERSION: $(ETCD_VERSION))
Expand Down

0 comments on commit 7655708

Please sign in to comment.