Commit 0ad50d20 authored by Kubernetes Submit Queue's avatar Kubernetes Submit Queue Committed by GitHub

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.
parents 0331b27f 48c1e83a
...@@ -62,7 +62,7 @@ runTests() { ...@@ -62,7 +62,7 @@ runTests() {
# TODO: Re-enable race detection when we switch to a thread-safe etcd client # TODO: Re-enable race detection when we switch to a thread-safe etcd client
# KUBE_RACE="-race" # KUBE_RACE="-race"
make -C "${KUBE_ROOT}" test \ 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_GOFLAGS="${KUBE_GOFLAGS:-} -short=true -tags 'integration no-docker'" \
KUBE_TEST_ARGS="${KUBE_TEST_ARGS:-} --vmodule=garbage*collector*=6 --alsologtostderr=true" \ KUBE_TEST_ARGS="${KUBE_TEST_ARGS:-} --vmodule=garbage*collector*=6 --alsologtostderr=true" \
KUBE_RACE="" \ KUBE_RACE="" \
...@@ -90,8 +90,20 @@ if [[ -n "${KUBE_TEST_ARGS}" ]]; then ...@@ -90,8 +90,20 @@ if [[ -n "${KUBE_TEST_ARGS}" ]]; then
runTests v1 runTests v1
fi 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 # Convert the CSV to an array of API versions to test
IFS=';' read -a apiVersions <<< "${KUBE_TEST_API_VERSIONS}" IFS=';' read -a apiVersions <<< "${KUBE_TEST_API_VERSIONS}"
for apiVersion in "${apiVersions[@]}"; do for apiVersion in "${apiVersions[@]}"; do
runTests "${apiVersion}" "${1-}" runTests "${apiVersion}" "${1-}" "${what_flags[@]}"
done done
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment