Skip to content

Commit 1a643c3

Browse files
committed
TEST_ARGS should also use array
1 parent 9c3939b commit 1a643c3

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

.evergreen/run-tests.sh

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ set -o xtrace
3131
AUTH=${AUTH:-noauth}
3232
SSL=${SSL:-nossl}
3333
TEST_SUITES=${TEST_SUITES:-}
34-
TEST_ARGS="${*:1}"
34+
TEST_ARGS=("${*:1}")
3535

3636
export PIP_QUIET=1 # Quiet by default
3737
export PIP_PREFER_BINARY=1 # Prefer binary dists by default
@@ -206,6 +206,7 @@ if [ -n "$TEST_INDEX_MANAGEMENT" ]; then
206206
TEST_SUITES="index_management"
207207
fi
208208

209+
# shellcheck disable=SC2128
209210
if [ -n "$TEST_DATA_LAKE" ] && [ -z "$TEST_ARGS" ]; then
210211
TEST_SUITES="data_lake"
211212
fi
@@ -235,7 +236,7 @@ if [ -n "$PERF_TEST" ]; then
235236
TEST_SUITES="perf"
236237
# PYTHON-4769 Run perf_test.py directly otherwise pytest's test collection negatively
237238
# affects the benchmark results.
238-
TEST_ARGS="test/performance/perf_test.py $TEST_ARGS"
239+
TEST_ARGS+=("test/performance/perf_test.py")
239240
fi
240241

241242
echo "Running $AUTH tests over $SSL with python $(uv python find)"
@@ -251,7 +252,7 @@ if [ -n "$COVERAGE" ] && [ "$PYTHON_IMPL" = "CPython" ]; then
251252
# Keep in sync with combine-coverage.sh.
252253
# coverage >=5 is needed for relative_files=true.
253254
UV_ARGS+=("--group coverage")
254-
TEST_ARGS="$TEST_ARGS --cov"
255+
TEST_ARGS+=("--cov")
255256
fi
256257

257258
if [ -n "$GREEN_FRAMEWORK" ]; then
@@ -265,7 +266,7 @@ PIP_QUIET=0 uv run ${UV_ARGS[*]} --with pip pip list
265266
if [ -z "$GREEN_FRAMEWORK" ]; then
266267
# Use --capture=tee-sys so pytest prints test output inline:
267268
# https://docs.pytest.org/en/stable/how-to/capture-stdout-stderr.html
268-
PYTEST_ARGS=("-v" "--capture=tee-sys" "--durations=5" "$TEST_ARGS")
269+
PYTEST_ARGS=("-v" "--capture=tee-sys" "--durations=5" "${TEST_ARGS[@]}")
269270
if [ -n "$TEST_SUITES" ]; then
270271
# Workaround until unittest -> pytest conversion is complete
271272
if [[ "$TEST_SUITES" == *"default_async"* ]]; then
@@ -293,7 +294,7 @@ if [ -z "$GREEN_FRAMEWORK" ]; then
293294
fi
294295
else
295296
# shellcheck disable=SC2048
296-
uv run ${UV_ARGS[*]} green_framework_test.py $GREEN_FRAMEWORK -v $TEST_ARGS
297+
uv run ${UV_ARGS[*]} green_framework_test.py $GREEN_FRAMEWORK -v "${TEST_ARGS[@]}"
297298
fi
298299

299300
# Handle perf test post actions.

0 commit comments

Comments
 (0)