mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-03 17:30:00 +00:00
Only normalize user-provided test targets
This commit is contained in:
parent
211d67a511
commit
7d89e9b4c0
@ -147,6 +147,9 @@ goflags=()
|
|||||||
|
|
||||||
# Filter out arguments that start with "-" and move them to goflags.
|
# Filter out arguments that start with "-" and move them to goflags.
|
||||||
testcases=()
|
testcases=()
|
||||||
|
# if the user passed no target in, we can skip slow normalization.
|
||||||
|
normalize="true"
|
||||||
|
|
||||||
for arg; do
|
for arg; do
|
||||||
if [[ "${arg}" == -* ]]; then
|
if [[ "${arg}" == -* ]]; then
|
||||||
goflags+=("${arg}")
|
goflags+=("${arg}")
|
||||||
@ -155,8 +158,15 @@ for arg; do
|
|||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
if [[ ${#testcases[@]} -eq 0 ]]; then
|
if [[ ${#testcases[@]} -eq 0 ]]; then
|
||||||
|
normalize="false"
|
||||||
kube::util::read-array testcases < <(kube::test::find_dirs)
|
kube::util::read-array testcases < <(kube::test::find_dirs)
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [[ "${normalize}" == "true" ]]; then
|
||||||
|
# This can be slow!
|
||||||
|
kube::log::status "Normalizing Go targets"
|
||||||
|
kube::util::read-array testcases < <(kube::golang::normalize_go_targets "${testcases[@]}")
|
||||||
|
fi
|
||||||
set -- "${testcases[@]+${testcases[@]}}"
|
set -- "${testcases[@]+${testcases[@]}}"
|
||||||
|
|
||||||
if [[ -n "${KUBE_RACE}" ]] ; then
|
if [[ -n "${KUBE_RACE}" ]] ; then
|
||||||
@ -190,11 +200,6 @@ runTests() {
|
|||||||
|
|
||||||
installTools
|
installTools
|
||||||
|
|
||||||
# Try to normalize input names. This is slow!
|
|
||||||
local -a targets
|
|
||||||
kube::log::status "Normalizing Go targets"
|
|
||||||
kube::util::read-array targets < <(kube::golang::normalize_go_targets "$@")
|
|
||||||
|
|
||||||
# Enable coverage data collection?
|
# Enable coverage data collection?
|
||||||
local cover_msg
|
local cover_msg
|
||||||
local COMBINED_COVER_PROFILE
|
local COMBINED_COVER_PROFILE
|
||||||
@ -229,7 +234,7 @@ runTests() {
|
|||||||
go test -json \
|
go test -json \
|
||||||
"${goflags[@]:+${goflags[@]}}" \
|
"${goflags[@]:+${goflags[@]}}" \
|
||||||
"${KUBE_TIMEOUT}" \
|
"${KUBE_TIMEOUT}" \
|
||||||
"${targets[@]}" \
|
"$@" \
|
||||||
"${testargs[@]:+${testargs[@]}}" \
|
"${testargs[@]:+${testargs[@]}}" \
|
||||||
&& rc=$? || rc=$?
|
&& rc=$? || rc=$?
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user