Skip to content

Commit dc44b49

Browse files
authored
PYTHON-5217 Update Atlas Data Lake tests (#2209)
1 parent 1d866b3 commit dc44b49

File tree

7 files changed

+62
-65
lines changed

7 files changed

+62
-65
lines changed

.evergreen/config.yml

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -213,20 +213,6 @@ functions:
213213
params:
214214
file: ${DRIVERS_TOOLS}/mo-expansion.yml
215215

216-
"bootstrap data lake":
217-
- command: subprocess.exec
218-
type: setup
219-
params:
220-
binary: bash
221-
args:
222-
- ${DRIVERS_TOOLS}/.evergreen/atlas_data_lake/pull-mongohouse-image.sh
223-
- command: subprocess.exec
224-
type: setup
225-
params:
226-
binary: bash
227-
args:
228-
- ${DRIVERS_TOOLS}/.evergreen/atlas_data_lake/run-mongohouse-image.sh
229-
230216
"run doctests":
231217
- command: subprocess.exec
232218
type: test
@@ -404,13 +390,6 @@ tasks:
404390
TOPOLOGY: "replica_set"
405391
- func: "run tests"
406392

407-
- name: atlas-data-lake-tests
408-
commands:
409-
- func: "bootstrap data lake"
410-
- func: "run tests"
411-
vars:
412-
TEST_NAME: "data_lake"
413-
414393
- name: "test-aws-lambda-deployed"
415394
commands:
416395
- command: ec2.assume_role

.evergreen/generated_configs/tasks.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,21 @@ tasks:
88
TEST_NAME: atlas_connect
99
tags: [atlas_connect]
1010

11+
# Atlas data lake tests
12+
- name: test-atlas-data-lake-with_ext
13+
commands:
14+
- func: run tests
15+
vars:
16+
TEST_NAME: data_lake
17+
NO_EXT: "1"
18+
tags: [atlas_data_lake]
19+
- name: test-atlas-data-lake-without_ext
20+
commands:
21+
- func: run tests
22+
vars:
23+
TEST_NAME: data_lake
24+
tags: [atlas_data_lake]
25+
1126
# Aws tests
1227
- name: test-auth-aws-4.4-regular
1328
commands:

.evergreen/generated_configs/variants.yml

Lines changed: 6 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -65,43 +65,21 @@ buildvariants:
6565
PYTHON_BINARY: /opt/python/3.13/bin/python3
6666

6767
# Atlas data lake tests
68-
- name: atlas-data-lake-ubuntu-22-python3.9-auth-no-c
68+
- name: atlas-data-lake-ubuntu-22-python3.9
6969
tasks:
70-
- name: atlas-data-lake-tests
71-
display_name: Atlas Data Lake Ubuntu-22 Python3.9 Auth No C
70+
- name: .atlas_data_lake
71+
display_name: Atlas Data Lake Ubuntu-22 Python3.9
7272
run_on:
7373
- ubuntu2204-small
7474
expansions:
75-
AUTH: auth
76-
NO_EXT: "1"
77-
PYTHON_BINARY: /opt/python/3.9/bin/python3
78-
- name: atlas-data-lake-ubuntu-22-python3.9-auth
79-
tasks:
80-
- name: atlas-data-lake-tests
81-
display_name: Atlas Data Lake Ubuntu-22 Python3.9 Auth
82-
run_on:
83-
- ubuntu2204-small
84-
expansions:
85-
AUTH: auth
8675
PYTHON_BINARY: /opt/python/3.9/bin/python3
87-
- name: atlas-data-lake-ubuntu-22-python3.13-auth-no-c
76+
- name: atlas-data-lake-ubuntu-22-python3.13
8877
tasks:
89-
- name: atlas-data-lake-tests
90-
display_name: Atlas Data Lake Ubuntu-22 Python3.13 Auth No C
78+
- name: .atlas_data_lake
79+
display_name: Atlas Data Lake Ubuntu-22 Python3.13
9180
run_on:
9281
- ubuntu2204-small
9382
expansions:
94-
AUTH: auth
95-
NO_EXT: "1"
96-
PYTHON_BINARY: /opt/python/3.13/bin/python3
97-
- name: atlas-data-lake-ubuntu-22-python3.13-auth
98-
tasks:
99-
- name: atlas-data-lake-tests
100-
display_name: Atlas Data Lake Ubuntu-22 Python3.13 Auth
101-
run_on:
102-
- ubuntu2204-small
103-
expansions:
104-
AUTH: auth
10583
PYTHON_BINARY: /opt/python/3.13/bin/python3
10684

10785
# Aws auth tests

.evergreen/scripts/generate_config.py

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ def zip_cycle(*iterables, empty_default=None):
213213
yield tuple(next(i, empty_default) for i in cycles)
214214

215215

216-
def handle_c_ext(c_ext, expansions):
216+
def handle_c_ext(c_ext, expansions) -> None:
217217
"""Handle c extension option."""
218218
if c_ext == C_EXTS[0]:
219219
expansions["NO_EXT"] = "1"
@@ -600,14 +600,10 @@ def create_no_c_ext_variants():
600600
def create_atlas_data_lake_variants():
601601
variants = []
602602
host = HOSTS["ubuntu22"]
603-
for python, c_ext in product(MIN_MAX_PYTHON, C_EXTS):
604-
tasks = ["atlas-data-lake-tests"]
605-
expansions = dict(AUTH="auth")
606-
handle_c_ext(c_ext, expansions)
607-
display_name = get_display_name("Atlas Data Lake", host, python=python, **expansions)
608-
variant = create_variant(
609-
tasks, display_name, host=host, python=python, expansions=expansions
610-
)
603+
for python in MIN_MAX_PYTHON:
604+
tasks = [".atlas_data_lake"]
605+
display_name = get_display_name("Atlas Data Lake", host, python=python)
606+
variant = create_variant(tasks, display_name, host=host, python=python)
611607
variants.append(variant)
612608
return variants
613609

@@ -970,6 +966,18 @@ def create_perf_tasks():
970966
return tasks
971967

972968

969+
def create_atlas_data_lake_tasks():
970+
tags = ["atlas_data_lake"]
971+
tasks = []
972+
for c_ext in C_EXTS:
973+
vars = dict(TEST_NAME="data_lake")
974+
handle_c_ext(c_ext, vars)
975+
test_func = FunctionCall(func="run tests", vars=vars)
976+
task_name = f"test-atlas-data-lake-{c_ext}"
977+
tasks.append(EvgTask(name=task_name, tags=tags, commands=[test_func]))
978+
return tasks
979+
980+
973981
def create_ocsp_tasks():
974982
tasks = []
975983
tests = [

.evergreen/scripts/setup_tests.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,12 @@ def handle_test_env() -> None:
175175
if not config:
176176
AUTH = "noauth"
177177

178+
if test_name == "data_lake":
179+
# Stop any running mongo-orchestration which might be using the port.
180+
run_command(f"bash {DRIVERS_TOOLS}/.evergreen/stop-orchestration.sh")
181+
run_command(f"bash {DRIVERS_TOOLS}/.evergreen/atlas_data_lake/setup.sh")
182+
AUTH = "auth"
183+
178184
if AUTH != "noauth":
179185
if test_name == "data_lake":
180186
config = read_env(f"{DRIVERS_TOOLS}/.evergreen/atlas_data_lake/secrets-export.sh")

.evergreen/scripts/teardown_tests.py

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

5858
teardown_mod_wsgi()
5959

60+
# Tear down data_lake if applicable.
61+
elif TEST_NAME == "data_lake":
62+
run_command(f"{DRIVERS_TOOLS}/.evergreen/atlas_data_lake/teardown.sh")
63+
6064
# Tear down coverage if applicable.
6165
if os.environ.get("COVERAGE"):
6266
shutil.rmtree(".pytest_cache", ignore_errors=True)

CONTRIBUTING.md

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -286,16 +286,23 @@ Note: these tests can only be run from an Evergreen Linux host that has the Pyth
286286
The `mode` can be `standalone` or `embedded`. For the `replica_set` version of the tests, use
287287
`TOPOLOGY=replica_set just run-server`.
288288

289+
### Atlas Data Lake tests.
290+
291+
You must have `docker` or `podman` installed locally.
292+
293+
- Run `just setup-tests data_lake`.
294+
- Run `just run-tests`.
295+
289296
### OCSP tests
290297

291-
- Export the orchestration file, e.g. `export ORCHESTRATION_FILE=rsa-basic-tls-ocsp-disableStapling.json`.
292-
This corresponds to a config file in `$DRIVERS_TOOLS/.evergreen/orchestration/configs/servers`.
293-
MongoDB servers on MacOS and Windows do not staple OCSP responses and only support RSA.
294-
- Run `just run-server ocsp`.
295-
- Run `just setup-tests ocsp <sub test>` (options are "valid", "revoked", "valid-delegate", "revoked-delegate").
296-
- Run `just run-tests`
298+
- Export the orchestration file, e.g. `export ORCHESTRATION_FILE=rsa-basic-tls-ocsp-disableStapling.json`.
299+
This corresponds to a config file in `$DRIVERS_TOOLS/.evergreen/orchestration/configs/servers`.
300+
MongoDB servers on MacOS and Windows do not staple OCSP responses and only support RSA.
301+
- Run `just run-server ocsp`.
302+
- Run `just setup-tests ocsp <sub test>` (options are "valid", "revoked", "valid-delegate", "revoked-delegate").
303+
- Run `just run-tests`
297304

298-
If you are running one of the `no-responder` tests, omit the `run-server` step.
305+
If you are running one of the `no-responder` tests, omit the `run-server` step.
299306

300307
### Perf Tests
301308

0 commit comments

Comments
 (0)