Skip to content

Commit d8143a5

Browse files
committed
cleanup
1 parent 0687c72 commit d8143a5

File tree

3 files changed

+25
-16
lines changed

3 files changed

+25
-16
lines changed

.evergreen/scripts/configure-env.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ EOT
7676

7777
# Write the .env file for drivers-tools.
7878
rm -rf $DRIVERS_TOOLS
79-
git clone --branch revert-574-ironage/TUNE-74 https://github.com/mongodb-labs/drivers-evergreen-tools.git $DRIVERS_TOOLS
79+
git clone https://github.com/mongodb-labs/drivers-evergreen-tools.git $DRIVERS_TOOLS
8080

8181
cat <<EOT > ${DRIVERS_TOOLS}/.env
8282
SKIP_LEGACY_SHELL=1

.evergreen/scripts/run_tests.py

Lines changed: 23 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@
2424
logging.basicConfig(level=logging.INFO, format="%(levelname)-8s %(message)s")
2525

2626

27-
def handle_perf(start_time: datetime, end_time: datetime):
27+
def handle_perf(start_time: datetime):
28+
end_time = datetime.now()
2829
elapsed_secs = (end_time - start_time).total_seconds()
2930
with open("results.json") as fid:
3031
results = json.load(fid)
@@ -68,24 +69,33 @@ def handle_green_framework() -> None:
6869
LOGGER.info(f"Running tests with {GREEN_FRAMEWORK}...")
6970

7071

72+
def handle_c_ext() -> None:
73+
if platform.python_implementation() != "CPython":
74+
return
75+
sys.path.insert(0, str(ROOT / "tools"))
76+
from fail_if_no_c import main as fail_if_no_c
77+
78+
fail_if_no_c()
79+
80+
81+
def handle_pymongocrypt() -> None:
82+
import pymongocrypt
83+
84+
LOGGER.info(f"pymongocrypt version: {pymongocrypt.__version__})")
85+
LOGGER.info(f"libmongocrypt version: {pymongocrypt.libmongocrypt_version()})")
86+
87+
7188
def run() -> None:
72-
# Handle green frameworks first so they can patch modules.
89+
# Handle green framework first so they can patch modules.
7390
if GREEN_FRAMEWORK:
7491
handle_green_framework()
7592

7693
# Ensure C extensions if applicable.
77-
if not os.environ.get("NO_EXT") and platform.python_implementation() == "CPython":
78-
sys.path.insert(0, str(ROOT / "tools"))
79-
from fail_if_no_c import main as fail_if_no_c
80-
81-
fail_if_no_c()
94+
if not os.environ.get("NO_EXT"):
95+
handle_c_ext()
8296

8397
if os.environ.get("PYMONGOCRYPT_LIB"):
84-
# Ensure pymongocrypt is working properly.
85-
import pymongocrypt
86-
87-
LOGGER.info(f"pymongocrypt version: {pymongocrypt.__version__})")
88-
LOGGER.info(f"libmongocrypt version: {pymongocrypt.libmongocrypt_version()})")
98+
handle_pymongocrypt()
8999

90100
LOGGER.info(f"Test setup:\n{AUTH=}\n{SSL=}\n{UV_ARGS=}\n{TEST_ARGS=}")
91101

@@ -98,8 +108,7 @@ def run() -> None:
98108

99109
# Handle perf test post actions.
100110
if TEST_PERF:
101-
end_time = datetime.now()
102-
handle_perf(start_time, end_time)
111+
handle_perf(start_time)
103112

104113
# Handle coverage post actions.
105114
if os.environ.get("COVERAGE"):

.evergreen/scripts/teardown-tests.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,6 @@ if [ -n "${TEST_ENCRYPTION:-}" ]; then
2424
fi
2525

2626
# Shut down load balancer if applicable.
27-
if [ -n "${TEST_LOADBALANCER:-}" ]; then
27+
if [ -n "${TEST_LOAD_BALANCER:-}" ]; then
2828
bash "${DRIVERS_TOOLS}"/.evergreen/run-load-balancer.sh stop
2929
fi

0 commit comments

Comments
 (0)