mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-29 06:27:05 +00:00
In hack/test-go.sh
treat arguments that start with a dash as go flags.
This fixes `hack/test-go.sh pkg/apiserver -test.run=<a_specific_test_name>` which was broken by PR #1116. Signed-off-by: Filipe Brandenburger <filbranden@google.com>
This commit is contained in:
parent
2df3ff51f4
commit
8effbdc63f
@ -94,6 +94,17 @@ shift $((OPTIND - 1))
|
|||||||
# Use eval to preserve embedded quoted strings.
|
# Use eval to preserve embedded quoted strings.
|
||||||
eval "goflags=(${GOFLAGS:-})"
|
eval "goflags=(${GOFLAGS:-})"
|
||||||
|
|
||||||
|
# Filter out arguments that start with "-" and move them to goflags.
|
||||||
|
testcases=()
|
||||||
|
for arg; do
|
||||||
|
if [[ "${arg}" == -* ]]; then
|
||||||
|
goflags+=("${arg}")
|
||||||
|
else
|
||||||
|
testcases+=("${arg}")
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
set -- ${testcases[@]+"${testcases[@]}"}
|
||||||
|
|
||||||
if [[ "${iterations}" -gt 1 ]]; then
|
if [[ "${iterations}" -gt 1 ]]; then
|
||||||
if [[ $# -eq 0 ]]; then
|
if [[ $# -eq 0 ]]; then
|
||||||
set -- $(find_test_dirs)
|
set -- $(find_test_dirs)
|
||||||
|
Loading…
Reference in New Issue
Block a user