diff --git a/hack/make-rules/test-integration.sh b/hack/make-rules/test-integration.sh index fa7b2084e53..d9631442c63 100755 --- a/hack/make-rules/test-integration.sh +++ b/hack/make-rules/test-integration.sh @@ -31,7 +31,7 @@ ALL_VERSIONS_CSV=$(IFS=',';echo "${KUBE_AVAILABLE_GROUP_VERSIONS[*]// /,}";IFS=$ KUBE_TEST_API_VERSIONS="${KUBE_TEST_API_VERSIONS:-${ALL_VERSIONS_CSV}}" # Give integration tests longer to run by default. -KUBE_TIMEOUT=${KUBE_TIMEOUT:--timeout 600s} +KUBE_TIMEOUT=${KUBE_TIMEOUT:--timeout=600s} KUBE_INTEGRATION_TEST_MAX_CONCURRENCY=${KUBE_INTEGRATION_TEST_MAX_CONCURRENCY:-"-1"} LOG_LEVEL=${LOG_LEVEL:-2} KUBE_TEST_ARGS=${KUBE_TEST_ARGS:-} diff --git a/hack/make-rules/test.sh b/hack/make-rules/test.sh index 8bd403625da..1c816c8017d 100755 --- a/hack/make-rules/test.sh +++ b/hack/make-rules/test.sh @@ -101,7 +101,7 @@ kube::test::find_dirs() { ) } -KUBE_TIMEOUT=${KUBE_TIMEOUT:--timeout 120s} +KUBE_TIMEOUT=${KUBE_TIMEOUT:--timeout=120s} KUBE_COVER=${KUBE_COVER:-n} # set to 'y' to enable coverage collection KUBE_COVERMODE=${KUBE_COVERMODE:-atomic} # How many 'go test' instances to run simultaneously when running tests in @@ -211,10 +211,6 @@ if [[ -n "${KUBE_RACE}" ]] ; then goflags+=("${KUBE_RACE}") fi -if [[ -n "${KUBE_TIMEOUT}" ]] ; then - while IFS='' read -r line; do goflags+=("$line"); done < <(echo "${KUBE_TIMEOUT}" | tr ' ' '\n') -fi - junitFilenamePrefix() { if [[ -z "${KUBE_JUNIT_REPORT_DIR}" ]]; then echo "" @@ -304,7 +300,7 @@ runTests() { if [[ ! ${KUBE_COVER} =~ ^[yY]$ ]]; then kube::log::status "Running tests without code coverage" go test "${goflags[@]:+${goflags[@]}}" \ - "${@}" \ + "${KUBE_TIMEOUT}" "${@}" \ "${testargs[@]:+${testargs[@]}}" \ | tee ${junit_filename_prefix:+"${junit_filename_prefix}.stdout"} \ | grep --binary-files=text "${go_test_grep_pattern}" && rc=$? || rc=$? @@ -344,6 +340,7 @@ runTests() { | xargs -I{} -n 1 -P "${KUBE_COVERPROCS}" \ bash -c "set -o pipefail; _pkg=\"\$0\"; _pkg_out=\${_pkg//\//_}; \ go test ${goflags[*]:+${goflags[*]}} \ + ${KUBE_TIMEOUT} \ -cover -covermode=\"${KUBE_COVERMODE}\" \ -coverprofile=\"${cover_report_dir}/\${_pkg}/${cover_profile}\" \ \"\${_pkg}\" \ diff --git a/test/cmd/kubeadm.sh b/test/cmd/kubeadm.sh index bef6edb5778..94bddf062fc 100755 --- a/test/cmd/kubeadm.sh +++ b/test/cmd/kubeadm.sh @@ -33,7 +33,7 @@ run_kubeadm_tests() { make -C "${KUBE_ROOT}" test \ WHAT=k8s.io/kubernetes/cmd/kubeadm/test/cmd \ KUBE_TEST_ARGS="--kubeadm-path '${KUBEADM_PATH}'" \ - KUBE_TIMEOUT="--timeout 600s" + KUBE_TIMEOUT="--timeout=600s" set +o nounset set +o errexit -} \ No newline at end of file +}