Skip to content

Commit 744b8bb

Browse files
committed
Revert "PYTHON-4558 Fix coverage and XML results for async tests"
This reverts commit 0396971.
1 parent 0396971 commit 744b8bb

File tree

2 files changed

+19
-14
lines changed

2 files changed

+19
-14
lines changed

.evergreen/run-tests.sh

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ set -o xtrace
3030

3131
AUTH=${AUTH:-noauth}
3232
SSL=${SSL:-nossl}
33-
TEST_SUITES="test/ test/asynchronous/"
3433
TEST_ARGS="${*:1}"
3534

3635
export PIP_QUIET=1 # Quiet by default
@@ -96,7 +95,7 @@ if [ -n "$TEST_LOADBALANCER" ]; then
9695
export LOAD_BALANCER=1
9796
export SINGLE_MONGOS_LB_URI="${SINGLE_MONGOS_LB_URI:-mongodb://127.0.0.1:8000/?loadBalanced=true}"
9897
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"
10099
fi
101100

102101
if [ "$SSL" != "nossl" ]; then
@@ -172,7 +171,9 @@ if [ -n "$TEST_ENCRYPTION" ]; then
172171
export PATH=$CRYPT_SHARED_DIR:$PATH
173172
fi
174173
# 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
176177
fi
177178

178179
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
186187
exit 1
187188
fi
188189

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
190193
fi
191194

192195
if [ -n "$TEST_INDEX_MANAGEMENT" ]; then
@@ -195,36 +198,36 @@ if [ -n "$TEST_INDEX_MANAGEMENT" ]; then
195198
set +x
196199
export DB_PASSWORD="${DRIVERS_ATLAS_LAMBDA_PASSWORD}"
197200
set -x
198-
TEST_SUITES="test/test_index_management.py"
201+
TEST_ARGS="test/test_index_management.py"
199202
fi
200203

201204
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"
203206
fi
204207

205208
if [ -n "$TEST_ATLAS" ]; then
206-
TEST_SUITES="test/atlas/test_connection.py"
209+
TEST_ARGS="test/atlas/test_connection.py"
207210
fi
208211

209212
if [ -n "$TEST_OCSP" ]; then
210213
python -m pip install ".[ocsp]"
211-
TEST_SUITES="test/ocsp/test_ocsp.py"
214+
TEST_ARGS="test/ocsp/test_ocsp.py"
212215
fi
213216

214217
if [ -n "$TEST_AUTH_AWS" ]; then
215218
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"
217220
fi
218221

219222
if [ -n "$TEST_AUTH_OIDC" ]; then
220223
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"
222225
fi
223226

224227
if [ -n "$PERF_TEST" ]; then
225228
python -m pip install simplejson
226229
start_time=$(date +%s)
227-
TEST_SUITES="test/performance/perf_test.py"
230+
TEST_ARGS="test/performance/perf_test.py"
228231
fi
229232

230233
echo "Running $AUTH tests over $SSL with python $(which python)"
@@ -254,7 +257,8 @@ PIP_QUIET=0 python -m pip list
254257
if [ -z "$GREEN_FRAMEWORK" ]; then
255258
# Use --capture=tee-sys so pytest prints test output inline:
256259
# 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
258262
else
259263
python green_framework_test.py $GREEN_FRAMEWORK -v $TEST_ARGS
260264
fi

.github/workflows/test-python.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -205,11 +205,12 @@ jobs:
205205
python-version: '3.8'
206206
- name: Start MongoDB
207207
uses: supercharge/mongodb-github-action@1.10.0
208-
- name: Run connect test from sdist
208+
- name: Run Test
209209
shell: bash
210210
run: |
211211
cd sdist/test
212212
ls
213213
which python
214214
pip install -e ".[test]"
215-
PYMONGO_MUST_CONNECT=1 pytest -v test/test_client_context.py
215+
pytest -v
216+
pytest -v test/asynchronous/

0 commit comments

Comments
 (0)