Skip to content

Commit e3a651f

Browse files
committed
Merge branch 'master' of github.com:mongodb/mongo-python-driver into PYTHON-5261
2 parents b43ed8b + 7243b43 commit e3a651f

File tree

4 files changed

+111
-63
lines changed

4 files changed

+111
-63
lines changed

.evergreen/config.yml

Lines changed: 0 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -290,63 +290,3 @@ post:
290290
- func: "upload mo artifacts"
291291
- func: "upload test results"
292292
- func: "cleanup"
293-
294-
tasks:
295-
# Wildcard task. Do you need to find out what tools are available and where?
296-
# Throw it here, and execute this task on all buildvariants
297-
- name: getdata
298-
commands:
299-
- command: subprocess.exec
300-
binary: bash
301-
type: test
302-
params:
303-
args:
304-
- src/.evergreen/scripts/run-getdata.sh
305-
306-
- name: "coverage-report"
307-
tags: ["coverage"]
308-
depends_on:
309-
# BUILD-3165: We can't use "*" (all tasks) and specify "variant".
310-
# Instead list out all coverage tasks using tags.
311-
- name: ".standalone"
312-
variant: ".coverage_tag"
313-
# Run the coverage task even if some tasks fail.
314-
status: "*"
315-
# Run the coverage task even if some tasks are not scheduled in a patch build.
316-
patch_optional: true
317-
- name: ".replica_set"
318-
variant: ".coverage_tag"
319-
status: "*"
320-
patch_optional: true
321-
- name: ".sharded_cluster"
322-
variant: ".coverage_tag"
323-
status: "*"
324-
patch_optional: true
325-
commands:
326-
- func: "download and merge coverage"
327-
328-
- name: "check-import-time"
329-
tags: ["pr"]
330-
commands:
331-
- command: subprocess.exec
332-
type: test
333-
params:
334-
binary: bash
335-
working_dir: src
336-
include_expansions_in_env: ["PYTHON_BINARY"]
337-
args:
338-
- .evergreen/scripts/check-import-time.sh
339-
- ${revision}
340-
- ${github_commit}
341-
- name: "backport-pr"
342-
allowed_requesters: ["commit"]
343-
commands:
344-
- command: subprocess.exec
345-
type: test
346-
params:
347-
binary: bash
348-
args:
349-
- ${DRIVERS_TOOLS}/.evergreen/github_app/backport-pr.sh
350-
- mongodb
351-
- mongo-python-driver
352-
- ${github_commit}

.evergreen/generated_configs/tasks.yml

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -713,6 +713,20 @@ tasks:
713713
AWS_ROLE_SESSION_NAME: test
714714
tags: [auth-aws, auth-aws-web-identity]
715715

716+
# Backport pr tests
717+
- name: backport-pr
718+
commands:
719+
- command: subprocess.exec
720+
params:
721+
binary: bash
722+
args:
723+
- ${DRIVERS_TOOLS}/.evergreen/github_app/backport-pr.sh
724+
- mongodb
725+
- mongo-python-driver
726+
- ${github_commit}
727+
working_dir: src
728+
type: test
729+
716730
# Compression tests
717731
- name: test-compression-v4.0-python3.9
718732
commands:
@@ -802,6 +816,25 @@ tasks:
802816
- func: run tests
803817
tags: [compression, latest]
804818

819+
# Coverage report tests
820+
- name: coverage-report
821+
commands:
822+
- func: download and merge coverage
823+
depends_on:
824+
- name: .standalone
825+
variant: .coverage_tag
826+
status: "*"
827+
patch_optional: true
828+
- name: .replica_set
829+
variant: .coverage_tag
830+
status: "*"
831+
patch_optional: true
832+
- name: .sharded_cluster
833+
variant: .coverage_tag
834+
status: "*"
835+
patch_optional: true
836+
tags: [coverage]
837+
805838
# Doctest tests
806839
- name: test-doctests
807840
commands:
@@ -865,6 +898,31 @@ tasks:
865898
- func: run tests
866899
tags: [free-threading]
867900

901+
# Getdata tests
902+
- name: getdata
903+
commands:
904+
- command: subprocess.exec
905+
params:
906+
binary: bash
907+
args:
908+
- .evergreen/scripts/run-getdata.sh
909+
working_dir: src
910+
type: test
911+
912+
# Import time tests
913+
- name: check-import-time
914+
commands:
915+
- command: subprocess.exec
916+
params:
917+
binary: bash
918+
args:
919+
- .evergreen/scripts/check-import-time.sh
920+
- ${revision}
921+
- ${github_commit}
922+
working_dir: src
923+
type: test
924+
tags: [pr]
925+
868926
# Kms tests
869927
- name: test-gcpkms
870928
commands:

.evergreen/scripts/generate_config.py

Lines changed: 52 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@
99
from typing import Any
1010

1111
from shrub.v3.evg_build_variant import BuildVariant
12-
from shrub.v3.evg_command import FunctionCall
12+
from shrub.v3.evg_command import EvgCommandType, FunctionCall, subprocess_exec
1313
from shrub.v3.evg_project import EvgProject
14-
from shrub.v3.evg_task import EvgTask, EvgTaskRef
14+
from shrub.v3.evg_task import EvgTask, EvgTaskDependency, EvgTaskRef
1515
from shrub.v3.shrub_service import ShrubService
1616

1717
##############
@@ -233,6 +233,13 @@ def handle_c_ext(c_ext, expansions) -> None:
233233
expansions["NO_EXT"] = "1"
234234

235235

236+
def get_subprocess_exec(**kwargs):
237+
kwargs.setdefault("binary", "bash")
238+
kwargs.setdefault("working_dir", "src")
239+
kwargs.setdefault("command_type", EvgCommandType.TEST)
240+
return subprocess_exec(**kwargs)
241+
242+
236243
def generate_yaml(tasks=None, variants=None):
237244
"""Generate the yaml for a given set of tasks and variants."""
238245
project = EvgProject(tasks=tasks, buildvariants=variants)
@@ -1068,6 +1075,49 @@ def create_atlas_data_lake_tasks():
10681075
return tasks
10691076

10701077

1078+
def create_getdata_tasks():
1079+
# Wildcard task. Do you need to find out what tools are available and where?
1080+
# Throw it here, and execute this task on all buildvariants
1081+
cmd = get_subprocess_exec(args=[".evergreen/scripts/run-getdata.sh"])
1082+
return [EvgTask(name="getdata", commands=[cmd])]
1083+
1084+
1085+
def create_coverage_report_tasks():
1086+
tags = ["coverage"]
1087+
task_name = "coverage-report"
1088+
# BUILD-3165: We can't use "*" (all tasks) and specify "variant".
1089+
# Instead list out all coverage tasks using tags.
1090+
# Run the coverage task even if some tasks fail.
1091+
# Run the coverage task even if some tasks are not scheduled in a patch build.
1092+
task_deps = []
1093+
for name in [".standalone", ".replica_set", ".sharded_cluster"]:
1094+
task_deps.append(
1095+
EvgTaskDependency(name=name, variant=".coverage_tag", status="*", patch_optional=True)
1096+
)
1097+
cmd = FunctionCall(func="download and merge coverage")
1098+
return [EvgTask(name=task_name, tags=tags, depends_on=task_deps, commands=[cmd])]
1099+
1100+
1101+
def create_import_time_tasks():
1102+
name = "check-import-time"
1103+
tags = ["pr"]
1104+
args = [".evergreen/scripts/check-import-time.sh", "${revision}", "${github_commit}"]
1105+
cmd = get_subprocess_exec(args=args)
1106+
return [EvgTask(name=name, tags=tags, commands=[cmd])]
1107+
1108+
1109+
def create_backport_pr_tasks():
1110+
name = "backport-pr"
1111+
args = [
1112+
"${DRIVERS_TOOLS}/.evergreen/github_app/backport-pr.sh",
1113+
"mongodb",
1114+
"mongo-python-driver",
1115+
"${github_commit}",
1116+
]
1117+
cmd = get_subprocess_exec(args=args)
1118+
return [EvgTask(name=name, commands=[cmd], allowed_requesters=["commit"])]
1119+
1120+
10711121
def create_ocsp_tasks():
10721122
tasks = []
10731123
tests = [

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,4 +121,4 @@ repos:
121121
entry: .evergreen/scripts/generate-config.sh
122122
language: python
123123
require_serial: true
124-
additional_dependencies: ["shrub.py>=3.2.0", "pyyaml>=6.0.2"]
124+
additional_dependencies: ["shrub.py>=3.8.0", "pyyaml>=6.0.2"]

0 commit comments

Comments
 (0)