@@ -31,7 +31,7 @@ set -o xtrace
3131AUTH=${AUTH:- noauth}
3232SSL=${SSL:- nossl}
3333TEST_SUITES=${TEST_SUITES:- }
34- TEST_ARGS=" ${*: 1} "
34+ TEST_ARGS=( " ${*: 1} " )
3535
3636export PIP_QUIET=1 # Quiet by default
3737export PIP_PREFER_BINARY=1 # Prefer binary dists by default
@@ -206,6 +206,7 @@ if [ -n "$TEST_INDEX_MANAGEMENT" ]; then
206206 TEST_SUITES=" index_management"
207207fi
208208
209+ # shellcheck disable=SC2128
209210if [ -n " $TEST_DATA_LAKE " ] && [ -z " $TEST_ARGS " ]; then
210211 TEST_SUITES=" data_lake"
211212fi
@@ -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" )
239240fi
240241
241242echo " 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" )
255256fi
256257
257258if [ -n " $GREEN_FRAMEWORK " ]; then
@@ -265,7 +266,7 @@ PIP_QUIET=0 uv run ${UV_ARGS[*]} --with pip pip list
265266if [ -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
294295else
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[@]} "
297298fi
298299
299300# Handle perf test post actions.
0 commit comments