Merge pull request #31533 from deads2k/partial-test-integration

Automatic merge from submit-queue

choose a particular directory test-integration

Enables `make test-integration WHAT=auth` or whatever particular integration test director you want to run.
This commit is contained in:
Kubernetes Submit Queue 2016-09-07 19:16:07 -07:00 committed by GitHub
commit f90df2448d
3 changed files with 16 additions and 9 deletions

View File

@ -119,11 +119,15 @@ check test: generated_files
# Build and run integration tests. # Build and run integration tests.
# #
# Args:
# WHAT: Directory names to test. All *_test.go files under these
# directories will be run. If not specified, "everything" will be tested.
#
# Example: # Example:
# make test-integration # make test-integration
.PHONY: test-integration .PHONY: test-integration
test-integration: generated_files test-integration: generated_files
hack/make-rules/test-integration.sh hack/make-rules/test-integration.sh $(WHAT)
# Build and run end-to-end tests. # Build and run end-to-end tests.
# #

View File

@ -40,7 +40,7 @@ KUBE_TEST_ARGS=${KUBE_TEST_ARGS:-}
kube::test::find_integration_test_dirs() { kube::test::find_integration_test_dirs() {
( (
cd ${KUBE_ROOT} cd ${KUBE_ROOT}
find test/integration -name '*_test.go' -print0 \ find test/integration/${1-} -name '*_test.go' -print0 \
| xargs -0n1 dirname \ | xargs -0n1 dirname \
| sort -u | sort -u
) )
@ -60,7 +60,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 | paste -sd' ' -)" \ WHAT="$(kube::test::find_integration_test_dirs ${2-} | paste -sd' ' -)" \
KUBE_GOFLAGS="${KUBE_GOFLAGS:-} -tags 'integration no-docker'" \ KUBE_GOFLAGS="${KUBE_GOFLAGS:-} -tags 'integration no-docker'" \
KUBE_TEST_ARGS="--vmodule=garbage*collector=6" \ KUBE_TEST_ARGS="--vmodule=garbage*collector=6" \
KUBE_RACE="" \ KUBE_RACE="" \
@ -91,5 +91,5 @@ 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}" runTests "${apiVersion}" "${1-}"
done done

View File

@ -22,14 +22,17 @@ set -o pipefail
KUBE_ROOT=$(dirname "${BASH_SOURCE}")/.. KUBE_ROOT=$(dirname "${BASH_SOURCE}")/..
# For help output
ARGHELP=""
if [[ "$#" -gt 0 ]]; then
ARGHELP="WHAT='$@'"
fi
echo "NOTE: $0 has been replaced by 'make test-integration'" echo "NOTE: $0 has been replaced by 'make test-integration'"
echo echo
echo "The equivalent of this invocation is: " echo "The equivalent of this invocation is: "
echo " make test-integration" echo " make test-integration ${ARGHELP}"
echo echo
echo echo
echo make --no-print-directory -C "${KUBE_ROOT}" test-integration make --no-print-directory -C "${KUBE_ROOT}" test-integration WHAT="$*"
echo
echo
make --no-print-directory -C "${KUBE_ROOT}" test-integration