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