@@ -30,7 +30,6 @@ set -o xtrace
30
30
31
31
AUTH=${AUTH:- noauth}
32
32
SSL=${SSL:- nossl}
33
- TEST_SUITES=" test/ test/asynchronous/"
34
33
TEST_ARGS=" ${*: 1} "
35
34
36
35
export PIP_QUIET=1 # Quiet by default
@@ -96,7 +95,7 @@ if [ -n "$TEST_LOADBALANCER" ]; then
96
95
export LOAD_BALANCER=1
97
96
export SINGLE_MONGOS_LB_URI=" ${SINGLE_MONGOS_LB_URI:- mongodb:// 127.0.0.1: 8000/ ?loadBalanced=true} "
98
97
export MULTI_MONGOS_LB_URI=" ${MULTI_MONGOS_LB_URI:- mongodb:// 127.0.0.1: 8001/ ?loadBalanced=true} "
99
- export TEST_SUITES =" test/test_load_balancer.py"
98
+ export TEST_ARGS =" test/test_load_balancer.py"
100
99
fi
101
100
102
101
if [ " $SSL " != " nossl" ]; then
@@ -172,7 +171,9 @@ if [ -n "$TEST_ENCRYPTION" ]; then
172
171
export PATH=$CRYPT_SHARED_DIR :$PATH
173
172
fi
174
173
# Only run the encryption tests.
175
- TEST_SUITES=" test/test_encryption.py"
174
+ if [ -z " $TEST_ARGS " ]; then
175
+ TEST_ARGS=" test/test_encryption.py"
176
+ fi
176
177
fi
177
178
178
179
if [ -n " $TEST_FLE_AZURE_AUTO " ] || [ -n " $TEST_FLE_GCP_AUTO " ]; then
@@ -186,7 +187,9 @@ if [ -n "$TEST_FLE_AZURE_AUTO" ] || [ -n "$TEST_FLE_GCP_AUTO" ]; then
186
187
exit 1
187
188
fi
188
189
189
- TEST_SUITES=" test/test_on_demand_csfle.py"
190
+ if [ -z " $TEST_ARGS " ]; then
191
+ TEST_ARGS=" test/test_on_demand_csfle.py"
192
+ fi
190
193
fi
191
194
192
195
if [ -n " $TEST_INDEX_MANAGEMENT " ]; then
@@ -195,36 +198,36 @@ if [ -n "$TEST_INDEX_MANAGEMENT" ]; then
195
198
set +x
196
199
export DB_PASSWORD=" ${DRIVERS_ATLAS_LAMBDA_PASSWORD} "
197
200
set -x
198
- TEST_SUITES =" test/test_index_management.py"
201
+ TEST_ARGS =" test/test_index_management.py"
199
202
fi
200
203
201
204
if [ -n " $TEST_DATA_LAKE " ] && [ -z " $TEST_ARGS " ]; then
202
- TEST_SUITES =" test/test_data_lake.py"
205
+ TEST_ARGS =" test/test_data_lake.py"
203
206
fi
204
207
205
208
if [ -n " $TEST_ATLAS " ]; then
206
- TEST_SUITES =" test/atlas/test_connection.py"
209
+ TEST_ARGS =" test/atlas/test_connection.py"
207
210
fi
208
211
209
212
if [ -n " $TEST_OCSP " ]; then
210
213
python -m pip install " .[ocsp]"
211
- TEST_SUITES =" test/ocsp/test_ocsp.py"
214
+ TEST_ARGS =" test/ocsp/test_ocsp.py"
212
215
fi
213
216
214
217
if [ -n " $TEST_AUTH_AWS " ]; then
215
218
python -m pip install " .[aws]"
216
- TEST_SUITES =" test/auth_aws/test_auth_aws.py"
219
+ TEST_ARGS =" test/auth_aws/test_auth_aws.py"
217
220
fi
218
221
219
222
if [ -n " $TEST_AUTH_OIDC " ]; then
220
223
python -m pip install " .[aws]"
221
- TEST_SUITES =" test/auth_oidc/test_auth_oidc.py $TEST_ARGS "
224
+ TEST_ARGS =" test/auth_oidc/test_auth_oidc.py $TEST_ARGS "
222
225
fi
223
226
224
227
if [ -n " $PERF_TEST " ]; then
225
228
python -m pip install simplejson
226
229
start_time=$( date +%s)
227
- TEST_SUITES =" test/performance/perf_test.py"
230
+ TEST_ARGS =" test/performance/perf_test.py"
228
231
fi
229
232
230
233
echo " Running $AUTH tests over $SSL with python $( which python) "
@@ -254,7 +257,8 @@ PIP_QUIET=0 python -m pip list
254
257
if [ -z " $GREEN_FRAMEWORK " ]; then
255
258
# Use --capture=tee-sys so pytest prints test output inline:
256
259
# https://docs.pytest.org/en/stable/how-to/capture-stdout-stderr.html
257
- python -m pytest -v --capture=tee-sys --durations=5 --maxfail=10 $TEST_SUITES $TEST_ARGS
260
+ python -m pytest -v --capture=tee-sys --durations=5 --maxfail=10 $TEST_ARGS
261
+ python -m pytest -v --capture=tee-sys --durations=5 --maxfail=10 test/asynchronous/ $TEST_ARGS
258
262
else
259
263
python green_framework_test.py $GREEN_FRAMEWORK -v $TEST_ARGS
260
264
fi
0 commit comments