File tree Expand file tree Collapse file tree 1 file changed +11
-6
lines changed Expand file tree Collapse file tree 1 file changed +11
-6
lines changed Original file line number Diff line number Diff line change @@ -147,6 +147,9 @@ goflags=()
147
147
148
148
# Filter out arguments that start with "-" and move them to goflags.
149
149
testcases=()
150
+ # if the user passed no target in, we can skip slow normalization.
151
+ normalize=" true"
152
+
150
153
for arg; do
151
154
if [[ " ${arg} " == -* ]]; then
152
155
goflags+=(" ${arg} " )
@@ -155,8 +158,15 @@ for arg; do
155
158
fi
156
159
done
157
160
if [[ ${# testcases[@]} -eq 0 ]]; then
161
+ normalize=" false"
158
162
kube::util::read-array testcases < <( kube::test::find_dirs)
159
163
fi
164
+
165
+ if [[ " ${normalize} " == " true" ]]; then
166
+ # This can be slow!
167
+ kube::log::status " Normalizing Go targets"
168
+ kube::util::read-array testcases < <( kube::golang::normalize_go_targets " ${testcases[@]} " )
169
+ fi
160
170
set -- " ${testcases[@]+${testcases[@]} } "
161
171
162
172
if [[ -n " ${KUBE_RACE} " ]] ; then
@@ -190,11 +200,6 @@ runTests() {
190
200
191
201
installTools
192
202
193
- # Try to normalize input names. This is slow!
194
- local -a targets
195
- kube::log::status " Normalizing Go targets"
196
- kube::util::read-array targets < <( kube::golang::normalize_go_targets " $@ " )
197
-
198
203
# Enable coverage data collection?
199
204
local cover_msg
200
205
local COMBINED_COVER_PROFILE
@@ -229,7 +234,7 @@ runTests() {
229
234
go test -json \
230
235
" ${goflags[@]: +${goflags[@]} } " \
231
236
" ${KUBE_TIMEOUT} " \
232
- " ${targets[@]} " \
237
+ " $@ " \
233
238
" ${testargs[@]: +${testargs[@]} } " \
234
239
&& rc=$? || rc=$?
235
240
You can’t perform that action at this time.
0 commit comments