mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-05 10:19:50 +00:00
Merge pull request #76855 from SataQiu/fix-hack-shell-20190420
fix bug of hack/verify-test-featuregates.sh
This commit is contained in:
commit
a73980e1e6
@ -37,6 +37,7 @@
|
|||||||
./hack/update-vendor.sh
|
./hack/update-vendor.sh
|
||||||
./hack/verify-golint.sh
|
./hack/verify-golint.sh
|
||||||
./hack/verify-no-vendor-cycles.sh
|
./hack/verify-no-vendor-cycles.sh
|
||||||
|
./hack/verify-test-featuregates.sh
|
||||||
./test/cmd/apply.sh
|
./test/cmd/apply.sh
|
||||||
./test/cmd/apps.sh
|
./test/cmd/apps.sh
|
||||||
./test/cmd/authorization.sh
|
./test/cmd/authorization.sh
|
||||||
|
@ -26,7 +26,7 @@ cd "${KUBE_ROOT}"
|
|||||||
rc=0
|
rc=0
|
||||||
|
|
||||||
# find test files accessing the mutable global feature gate or interface
|
# 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
|
if [[ -n "${direct_sets}" ]]; then
|
||||||
echo "Test files may not access mutable global feature gates directly:" >&2
|
echo "Test files may not access mutable global feature gates directly:" >&2
|
||||||
echo "${direct_sets}" >&2
|
echo "${direct_sets}" >&2
|
||||||
@ -38,7 +38,7 @@ if [[ -n "${direct_sets}" ]]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# find test files calling SetFeatureGateDuringTest and not calling the result
|
# 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
|
if [[ -n "${missing_defers}" ]]; then
|
||||||
echo "Invalid invocations of utilfeaturetesting.SetFeatureGateDuringTest():" >&2
|
echo "Invalid invocations of utilfeaturetesting.SetFeatureGateDuringTest():" >&2
|
||||||
echo "${missing_defers}" >&2
|
echo "${missing_defers}" >&2
|
||||||
|
Loading…
Reference in New Issue
Block a user