Skip to content

Commit 31dfaf3

Browse files
committed
prow.sh: fix running of just "alpha" tests
"grep -w" treated "serial-alpha" as two words and therefore CSI_PROW_TESTS sometimes ran too many tests.
1 parent f501443 commit 31dfaf3

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

prow.sh

+10-1
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,16 @@ configvar CSI_PROW_SANITY_CONTAINER "hostpath" "Kubernetes container with CSI dr
203203
# by setting CSI_PROW_TESTS_SANITY.
204204
configvar CSI_PROW_TESTS "unit parallel serial parallel-alpha serial-alpha ${CSI_PROW_TESTS_SANITY}" "tests to run"
205205
test_enabled () {
206-
echo "${CSI_PROW_TESTS}" | grep -q -w -e "$1"
206+
local test="$1"
207+
# We want word-splitting here, so ignore: Double quote to prevent globbing and word splitting.
208+
# shellcheck disable=SC2086
209+
set ${CSI_PROW_TESTS}
210+
for t in "$@"; do
211+
if [ "$t" = "$test" ]; then
212+
return
213+
fi
214+
done
215+
return 1
207216
}
208217

209218
# Serial vs. parallel is always determined by these regular expressions.

0 commit comments

Comments
 (0)