From 58caa7474fe603a99c45837933bae2ae61d59b9e Mon Sep 17 00:00:00 2001 From: SataQiu Date: Wed, 24 Apr 2019 11:30:28 +0800 Subject: [PATCH] fix bug of hack/verify-test-featuregates.sh --- hack/.shellcheck_failures | 1 + hack/verify-test-featuregates.sh | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/hack/.shellcheck_failures b/hack/.shellcheck_failures index 40fbd96ed74..905b630d783 100644 --- a/hack/.shellcheck_failures +++ b/hack/.shellcheck_failures @@ -39,6 +39,7 @@ ./hack/update-vendor.sh ./hack/verify-golint.sh ./hack/verify-no-vendor-cycles.sh +./hack/verify-test-featuregates.sh ./test/cmd/apply.sh ./test/cmd/apps.sh ./test/cmd/authorization.sh diff --git a/hack/verify-test-featuregates.sh b/hack/verify-test-featuregates.sh index 12175f0472f..ba36fcb86e4 100755 --- a/hack/verify-test-featuregates.sh +++ b/hack/verify-test-featuregates.sh @@ -26,7 +26,7 @@ cd "${KUBE_ROOT}" rc=0 # find test files accessing the mutable global feature gate or interface -direct_sets=$(grep -n --include './*_test.go' -R 'MutableFeatureGate' . 2>/dev/null) || true +direct_sets=$(grep -n --include '*_test.go' -R 'MutableFeatureGate' . 2>/dev/null) || true if [[ -n "${direct_sets}" ]]; then echo "Test files may not access mutable global feature gates directly:" >&2 echo "${direct_sets}" >&2 @@ -38,7 +38,7 @@ if [[ -n "${direct_sets}" ]]; then fi # find test files calling SetFeatureGateDuringTest and not calling the result -missing_defers=$(grep -n --include './*_test.go' -R 'SetFeatureGateDuringTest' . 2>/dev/null | grep -E -v "defer .*\\)\\(\\)$") || true +missing_defers=$(grep -n --include '*_test.go' -R 'SetFeatureGateDuringTest' . 2>/dev/null | grep -E -v "defer .*\\)\\(\\)$") || true if [[ -n "${missing_defers}" ]]; then echo "Invalid invocations of utilfeaturetesting.SetFeatureGateDuringTest():" >&2 echo "${missing_defers}" >&2