Skip to content

Commit

Permalink
prow.sh: fix running of just "alpha" tests
Browse files Browse the repository at this point in the history
"grep -w" treated "serial-alpha" as two words and therefore
CSI_PROW_TESTS sometimes ran too many tests.
  • Loading branch information
pohly committed Apr 8, 2019
1 parent f501443 commit 31dfaf3
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion prow.sh
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,16 @@ configvar CSI_PROW_SANITY_CONTAINER "hostpath" "Kubernetes container with CSI dr
# by setting CSI_PROW_TESTS_SANITY.
configvar CSI_PROW_TESTS "unit parallel serial parallel-alpha serial-alpha ${CSI_PROW_TESTS_SANITY}" "tests to run"
test_enabled () {
echo "${CSI_PROW_TESTS}" | grep -q -w -e "$1"
local test="$1"
# We want word-splitting here, so ignore: Double quote to prevent globbing and word splitting.
# shellcheck disable=SC2086
set ${CSI_PROW_TESTS}
for t in "$@"; do
if [ "$t" = "$test" ]; then
return
fi
done
return 1
}

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

0 comments on commit 31dfaf3

Please sign in to comment.