Merge pull request #16340 from jmhbnz/streamline-test-commands

[3.5] Backport Makefile recipes for common test commands
This commit is contained in:
Marek Siarkowicz 2023-08-02 15:54:21 +02:00 committed by GitHub
commit 81ed2b3cf7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 23 additions and 7 deletions

View File

@ -25,10 +25,10 @@ jobs:
echo "${TARGET}"
case "${TARGET}" in
linux-amd64-e2e)
PASSES='build release e2e' CPU='4' EXPECT_DEBUG='true' COVER='false' RACE='true' ./test.sh
CPU='4' EXPECT_DEBUG='true' COVER='false' RACE='true' make test-e2e-release
;;
linux-386-e2e)
GOARCH=386 PASSES='build e2e' CPU='4' EXPECT_DEBUG='true' COVER='false' RACE='true' ./test.sh
GOARCH=386 CPU='4' EXPECT_DEBUG='true' COVER='false' RACE='true' make test-e2e
;;
*)
echo "Failed to find target"

View File

@ -33,16 +33,16 @@ jobs:
GOARCH=amd64 PASSES='fmt bom dep' ./test.sh
;;
linux-amd64-integration-1-cpu)
GOARCH=amd64 CPU=1 PASSES='integration' RACE='false' ./test.sh
GOARCH=amd64 CPU=1 RACE='false' make test-integration
;;
linux-amd64-integration-2-cpu)
GOARCH=amd64 CPU=2 PASSES='integration' RACE='false' ./test.sh
GOARCH=amd64 CPU=2 RACE='false' make test-integration
;;
linux-amd64-integration-4-cpu)
GOARCH=amd64 CPU=4 PASSES='integration' RACE='false' ./test.sh
GOARCH=amd64 CPU=4 RACE='false' make test-integration
;;
linux-amd64-unit-4-cpu-race)
GOARCH=amd64 PASSES='unit' RACE='true' CPU='4' ./test.sh -p=2
GOARCH=amd64 RACE='true' CPU='4' GO_TEST_FLAGS='-p=2' make test-unit
;;
all-build)
GOARCH=amd64 PASSES='build' ./test.sh
@ -56,7 +56,7 @@ jobs:
GO_BUILD_FLAGS='-v -mod=readonly' GOARCH=s390x ./build.sh
;;
linux-386-unit-1-cpu)
GOARCH=386 PASSES='unit' RACE='false' CPU='1' ./test -p=4
GOARCH=386 RACE='false' CPU='1' GO_TEST_FLAGS='-p=4' make test-unit
;;
*)
echo "Failed to find target"

View File

@ -161,6 +161,22 @@ test-full:
$(info log-file: test-$(TEST_SUFFIX).log)
PASSES="fmt build release unit integration functional e2e grpcproxy" ./test.sh 2<&1 | tee test-$(TEST_SUFFIX).log
.PHONY: test-unit
test-unit:
PASSES="unit" ./test.sh $(GO_TEST_FLAGS)
.PHONY: test-integration
test-integration:
PASSES="integration" ./test.sh $(GO_TEST_FLAGS)
.PHONY: test-e2e
test-e2e:
PASSES="build e2e" ./test.sh $(GO_TEST_FLAGS)
.PHONY: test-e2e-release
test-e2e-release:
PASSES="build release e2e" ./test.sh $(GO_TEST_FLAGS)
ensure-docker-test-image-exists:
make pull-docker-test || ( echo "WARNING: Container Image not found in registry, building locally"; make build-docker-test )