Merge pull request #33952 from deads2k/annoyance-specific-integration-test

Automatic merge from submit-queue

specify flags to test-integration

Allows a specific test to be run in test-integration:  ` hack/test-integration.sh auth -test.run=TestKindAuthorization`

@eparis I don't know how good or bad my bash is.
This commit is contained in:
Kubernetes Submit Queue 2016-10-05 04:41:01 -07:00 committed by GitHub
commit 0ad50d2033

View File

@ -62,7 +62,7 @@ runTests() {
# TODO: Re-enable race detection when we switch to a thread-safe etcd client
# KUBE_RACE="-race"
make -C "${KUBE_ROOT}" test \
WHAT="$(kube::test::find_integration_test_dirs ${2-} | paste -sd' ' -)" \
WHAT="$(kube::test::find_integration_test_dirs ${2-} | paste -sd' ' -) $(echo ${@:3})" \
KUBE_GOFLAGS="${KUBE_GOFLAGS:-} -short=true -tags 'integration no-docker'" \
KUBE_TEST_ARGS="${KUBE_TEST_ARGS:-} --vmodule=garbage*collector*=6 --alsologtostderr=true" \
KUBE_RACE="" \
@ -90,8 +90,20 @@ if [[ -n "${KUBE_TEST_ARGS}" ]]; then
runTests v1
fi
# Pass arguments that begin with "-" and move them to goflags.
what_flags=()
for arg in "$@"; do
if [[ "${arg}" == -* ]]; then
what_flags+=("${arg}")
fi
done
if [[ "${#what_flags[@]}" -eq 0 ]]; then
what_flags=''
fi
# Convert the CSV to an array of API versions to test
IFS=';' read -a apiVersions <<< "${KUBE_TEST_API_VERSIONS}"
for apiVersion in "${apiVersions[@]}"; do
runTests "${apiVersion}" "${1-}"
runTests "${apiVersion}" "${1-}" "${what_flags[@]}"
done