Skip to content

Commit b2b6998

Browse files
committed
use specific python version
1 parent 012216a commit b2b6998

File tree

4 files changed

+12
-7
lines changed

4 files changed

+12
-7
lines changed

.evergreen/run-tests.sh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,10 @@ if [ -f "./secrets-export.sh" ]; then
3131
fi
3232

3333
# List the packages.
34-
PIP_QUIET=0 uv run ${UV_ARGS} --with pip pip list
34+
uv sync ${UV_ARGS}
35+
uv pip list
3536

3637
# Start the test runner.
37-
uv run ${UV_ARGS} .evergreen/scripts/run_tests.py "$@"
38+
uv run .evergreen/scripts/run_tests.py "$@"
3839

3940
popd

.evergreen/scripts/run_tests.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
import logging
55
import os
66
import platform
7-
import shutil
87
import sys
98
from datetime import datetime
109

@@ -142,10 +141,6 @@ def run() -> None:
142141
if TEST_PERF:
143142
handle_perf(start_time)
144143

145-
# Handle coverage post actions.
146-
if os.environ.get("COVERAGE"):
147-
shutil.rmtree(".pytest_cache", ignore_errors=True)
148-
149144

150145
if __name__ == "__main__":
151146
run()

.evergreen/scripts/setup_tests.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,9 @@
4343
# Map the test name to test group.
4444
GROUP_MAP = dict(mockupdb="mockupdb", perf="perf")
4545

46+
# The python version used for perf tests.
47+
PERF_PYTHON_VERSION = "3.9.13"
48+
4649

4750
def is_set(var: str) -> bool:
4851
value = os.environ.get(var, "")
@@ -371,6 +374,8 @@ def handle_test_env() -> None:
371374
write_env("TEST_PATH", str(data_dir))
372375
write_env("OUTPUT_FILE", str(ROOT / "results.json"))
373376

377+
UV_ARGS.append(f"--python={PERF_PYTHON_VERSION}")
378+
374379
# PYTHON-4769 Run perf_test.py directly otherwise pytest's test collection negatively
375380
# affects the benchmark results.
376381
if sub_test_name == "sync":

.evergreen/scripts/teardown_tests.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,4 +57,8 @@
5757

5858
teardown_mod_wsgi()
5959

60+
# Tear down coverage if applicable.
61+
if os.environ.get("COVERAGE"):
62+
shutil.rmtree(".pytest_cache", ignore_errors=True)
63+
6064
LOGGER.info(f"Tearing down tests of type '{TEST_NAME}'... done.")

0 commit comments

Comments
 (0)