Skip to content

Commit bc8bdb4

Browse files
authored
Merge branch 'master' into dependabot/pip/mypy-1.19.0
2 parents 69a505c + 2195866 commit bc8bdb4

File tree

15 files changed

+405
-95
lines changed

15 files changed

+405
-95
lines changed

.evergreen/generated_configs/functions.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -239,6 +239,19 @@ functions:
239239
working_dir: src
240240
type: test
241241

242+
# Test numpy
243+
test numpy:
244+
- command: subprocess.exec
245+
params:
246+
binary: bash
247+
args:
248+
- .evergreen/just.sh
249+
- test-numpy
250+
working_dir: src
251+
include_expansions_in_env:
252+
- TOOLCHAIN_VERSION
253+
type: test
254+
242255
# Upload coverage
243256
upload coverage:
244257
- command: ec2.assume_role

.evergreen/generated_configs/tasks.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4768,6 +4768,28 @@ tasks:
47684768
- noauth
47694769
- pypy
47704770

4771+
# Test numpy tests
4772+
- name: test-numpy-python3.10
4773+
commands:
4774+
- func: test numpy
4775+
vars:
4776+
TOOLCHAIN_VERSION: "3.10"
4777+
tags:
4778+
- binary
4779+
- vector
4780+
- python-3.10
4781+
- test-numpy
4782+
- name: test-numpy-python3.14
4783+
commands:
4784+
- func: test numpy
4785+
vars:
4786+
TOOLCHAIN_VERSION: "3.14"
4787+
tags:
4788+
- binary
4789+
- vector
4790+
- python-3.14
4791+
- test-numpy
4792+
47714793
# Test standard auth tests
47724794
- name: test-standard-auth-v4.2-python3.10-auth-ssl-sharded-cluster
47734795
commands:

.evergreen/generated_configs/variants.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -621,3 +621,42 @@ buildvariants:
621621
- rhel87-small
622622
expansions:
623623
STORAGE_ENGINE: inmemory
624+
625+
# Test numpy tests
626+
- name: test-numpy-rhel8
627+
tasks:
628+
- name: .test-numpy
629+
display_name: Test Numpy RHEL8
630+
run_on:
631+
- rhel87-small
632+
tags: [binary, vector, pr]
633+
- name: test-numpy-macos
634+
tasks:
635+
- name: .test-numpy
636+
display_name: Test Numpy macOS
637+
run_on:
638+
- macos-14
639+
tags: [binary, vector]
640+
- name: test-numpy-macos-arm64
641+
tasks:
642+
- name: .test-numpy
643+
display_name: Test Numpy macOS Arm64
644+
run_on:
645+
- macos-14-arm64
646+
tags: [binary, vector]
647+
- name: test-numpy-win64
648+
tasks:
649+
- name: .test-numpy
650+
display_name: Test Numpy Win64
651+
run_on:
652+
- windows-64-vsMulti-small
653+
tags: [binary, vector]
654+
- name: test-numpy-win32
655+
tasks:
656+
- name: .test-numpy
657+
display_name: Test Numpy Win32
658+
run_on:
659+
- windows-64-vsMulti-small
660+
expansions:
661+
IS_WIN32: "1"
662+
tags: [binary, vector]

.evergreen/scripts/generate_config.py

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -339,6 +339,37 @@ def create_disable_test_commands_variants():
339339
return [create_variant(tasks, display_name, host=host, expansions=expansions)]
340340

341341

342+
def create_test_numpy_tasks():
343+
tasks = []
344+
for python in MIN_MAX_PYTHON:
345+
tags = ["binary", "vector", f"python-{python}", "test-numpy"]
346+
task_name = get_task_name("test-numpy", python=python)
347+
test_func = FunctionCall(func="test numpy", vars=dict(TOOLCHAIN_VERSION=python))
348+
tasks.append(EvgTask(name=task_name, tags=tags, commands=[test_func]))
349+
return tasks
350+
351+
352+
def create_test_numpy_variants() -> list[BuildVariant]:
353+
variants = []
354+
base_display_name = "Test Numpy"
355+
356+
# Test a subset on each of the other platforms.
357+
for host_name in ("rhel8", "macos", "macos-arm64", "win64", "win32"):
358+
tasks = [".test-numpy"]
359+
host = HOSTS[host_name]
360+
tags = ["binary", "vector"]
361+
if host_name == "rhel8":
362+
tags.append("pr")
363+
expansions = dict()
364+
if host_name == "win32":
365+
expansions["IS_WIN32"] = "1"
366+
display_name = get_variant_name(base_display_name, host)
367+
variant = create_variant(tasks, display_name, host=host, tags=tags, expansions=expansions)
368+
variants.append(variant)
369+
370+
return variants
371+
372+
342373
def create_oidc_auth_variants():
343374
variants = []
344375
for host_name in ["ubuntu22", "macos", "win64"]:
@@ -1140,6 +1171,14 @@ def create_run_tests_func():
11401171
return "run tests", [setup_cmd, test_cmd]
11411172

11421173

1174+
def create_test_numpy_func():
1175+
includes = ["TOOLCHAIN_VERSION"]
1176+
test_cmd = get_subprocess_exec(
1177+
include_expansions_in_env=includes, args=[".evergreen/just.sh", "test-numpy"]
1178+
)
1179+
return "test numpy", [test_cmd]
1180+
1181+
11431182
def create_cleanup_func():
11441183
cmd = get_subprocess_exec(args=[".evergreen/scripts/cleanup.sh"])
11451184
return "cleanup", [cmd]

.evergreen/scripts/setup_tests.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
11
from __future__ import annotations
22

33
import base64
4-
import io
54
import os
65
import platform
76
import shutil
87
import stat
9-
import tarfile
108
from pathlib import Path
119
from urllib import request
1210

@@ -117,9 +115,10 @@ def setup_libmongocrypt():
117115
LOGGER.info(f"Fetching {url}...")
118116
with request.urlopen(request.Request(url), timeout=15.0) as response: # noqa: S310
119117
if response.status == 200:
120-
fileobj = io.BytesIO(response.read())
121-
with tarfile.open("libmongocrypt.tar.gz", fileobj=fileobj) as fid:
122-
fid.extractall(Path.cwd() / "libmongocrypt")
118+
with Path("libmongocrypt.tar.gz").open("wb") as f:
119+
f.write(response.read())
120+
Path("libmongocrypt").mkdir()
121+
run_command("tar -xzf libmongocrypt.tar.gz -C libmongocrypt")
123122
LOGGER.info(f"Fetching {url}... done.")
124123

125124
run_command("ls -la libmongocrypt")

.github/pull_request_template.md

Lines changed: 11 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,33 @@
11
<!-- Thanks for contributing! -->
22
<!-- Please ensure that the title of the PR is in the following form:
3-
[Issue Type]-[Issue Key]: Issue Title
3+
[JIRA TICKET]: Issue Title
44
55
If you are an external contributor and there is no JIRA ticket associated with your change, then use your best judgement
66
for the PR title. A MongoDB employee will create a JIRA ticket and edit the name and links as appropriate.
7+
8+
Note on AI Contributions:
9+
We do not accept pull requests that are primarily or substantially generated by AI tools (ChatGPT, Copilot, etc.).
10+
All contributions must be written and understood by human contributors.
711
-->
8-
[Issue Key](https://jira.mongodb.org/browse/%7BISSUE_KEY%7D)
9-
## Summary
10-
<!-- What conceptually is this PR introducing? If context is already provided from the JIRA ticket, still place it in the
11-
Pull Request as you should not make the reviewer do digging for a basic summary. -->
12+
[JIRA TICKET]
1213

1314
## Changes in this PR
1415
<!-- What changes did you make to the code? What new APIs (public or private) were added, removed, or edited to generate
1516
the desired outcome explained in the above summary? -->
1617

17-
## Testing Plan
18+
## Test Plan
1819
<!-- How did you test the code? If you added unit tests, you can say that. If you didn’t introduce unit tests, explain why.
1920
All code should be tested in some way – so please list what your validation strategy was. -->
2021

21-
### Screenshots (optional)
22-
<!-- Usually a great supplement to a test plan, especially if this requires local testing. -->
23-
2422
## Checklist
2523
<!-- Do not delete the items provided on this checklist. -->
24+
2625
### Checklist for Author
2726
- [ ] Did you update the changelog (if necessary)?
28-
- [ ] Is the intention of the code captured in relevant tests?
29-
- [ ] If there are new TODOs, has a related JIRA ticket been created?
27+
- [ ] Is there test coverage?
28+
- [ ] Is any followup work tracked in a JIRA ticket? If so, add link(s).
3029

31-
### Checklist for Reviewer {@primary_reviewer}
30+
### Checklist for Reviewer
3231
- [ ] Does the title of the PR reference a JIRA Ticket?
3332
- [ ] Do you fully understand the implementation? (Would you be comfortable explaining how this code works to someone else?)
34-
- [ ] Have you checked for spelling & grammar errors?
3533
- [ ] Is all relevant documentation (README or docstring) updated?
36-
37-
## Focus Areas for Reviewer (optional)
38-
<!-- List any complex portion of code you believe needs additional scrutiny and explain why. -->

.github/workflows/zizmor.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,4 @@ jobs:
1818
with:
1919
persist-credentials: false
2020
- name: Run zizmor 🌈
21-
uses: zizmorcore/zizmor-action@b0e5c0b2b3785bc67b9b6c743fdbd495cda1b4c4
21+
uses: zizmorcore/zizmor-action@c0e2b1c877e25a91d1d747c438d49199cad29698

CONTRIBUTING.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -387,6 +387,11 @@ If you are running one of the `no-responder` tests, omit the `run-server` step.
387387
To run any of the test suites with minimum supported dependencies, pass `--test-min-deps` to
388388
`just setup-tests`.
389389

390+
## Testing time-dependent operations
391+
392+
- `test.utils_shared.delay` - One can trigger an arbitrarily long-running operation on the server using this delay utility
393+
in combination with a `$where` operation. Use this to test behaviors around timeouts or signals.
394+
390395
## Adding a new test suite
391396

392397
- If adding new tests files that should only be run for that test suite, add a pytest marker to the file and add

0 commit comments

Comments
 (0)