From 973cc7d8c97263455d3b597634b4b4f285ff1e93 Mon Sep 17 00:00:00 2001 From: Steven Silvester Date: Mon, 14 Apr 2025 10:13:16 -0500 Subject: [PATCH 01/16] PYTHON-5313 Create min-max Evergreen tests --- .evergreen/generated_configs/tasks.yml | 75 ++++++++++++++++++++--- .evergreen/generated_configs/variants.yml | 16 ----- .evergreen/scripts/generate_config.py | 47 +++++++++----- 3 files changed, 98 insertions(+), 40 deletions(-) diff --git a/.evergreen/generated_configs/tasks.yml b/.evergreen/generated_configs/tasks.yml index 8d80b113a3..f5de4ab80b 100644 --- a/.evergreen/generated_configs/tasks.yml +++ b/.evergreen/generated_configs/tasks.yml @@ -1,13 +1,4 @@ tasks: - # Atlas connect tests - - name: test-atlas-connect - commands: - - func: assume ec2 role - - func: run tests - vars: - TEST_NAME: atlas_connect - tags: [atlas_connect] - # Atlas data lake tests - name: test-atlas-data-lake-without_ext commands: @@ -1166,6 +1157,72 @@ tasks: TEST_NAME: load_balancer tags: [load-balancer, noauth, nossl] + # Min max tests + - name: test-v4.0-python3.9-noauth-nossl-standalone + commands: + - func: assume ec2 role + - func: run server + vars: + AUTH: noauth + SSL: nossl + TOPOLOGY: standalone + VERSION: "4.0" + - func: run tests + vars: + AUTH: noauth + SSL: nossl + TOPOLOGY: standalone + VERSION: "4.0" + PYTHON_VERSION: "3.9" + tags: + - min-max-tests + - server-4.0 + - python-3.9 + - standalone-noauth-nossl + - name: test-latest-python3.13-auth-ssl-sharded-cluster + commands: + - func: assume ec2 role + - func: run server + vars: + AUTH: auth + SSL: ssl + TOPOLOGY: sharded_cluster + VERSION: latest + - func: run tests + vars: + AUTH: auth + SSL: ssl + TOPOLOGY: sharded_cluster + VERSION: latest + PYTHON_VERSION: "3.13" + tags: + - min-max-tests + - server-latest + - python-3.13 + - sharded_cluster-auth-ssl + - name: test-v4.0-pypy3.10-noauth-ssl-replica-set + commands: + - func: assume ec2 role + - func: run server + vars: + AUTH: noauth + SSL: ssl + TOPOLOGY: replica_set + VERSION: "4.0" + - func: run tests + vars: + AUTH: noauth + SSL: ssl + TOPOLOGY: replica_set + VERSION: "4.0" + PYTHON_VERSION: pypy3.10 + tags: + - min-max-tests + - server-4.0 + - python-pypy3.10 + - replica_set-noauth-ssl + - pypy + # Mockupdb tests - name: test-mockupdb commands: diff --git a/.evergreen/generated_configs/variants.yml b/.evergreen/generated_configs/variants.yml index 0ad366dbea..0a51eec9d6 100644 --- a/.evergreen/generated_configs/variants.yml +++ b/.evergreen/generated_configs/variants.yml @@ -59,22 +59,6 @@ buildvariants: NO_EXT: "1" # Atlas connect tests - - name: atlas-connect-rhel8-python3.9 - tasks: - - name: .atlas_connect - display_name: Atlas connect RHEL8 Python3.9 - run_on: - - rhel87-small - expansions: - PYTHON_BINARY: /opt/python/3.9/bin/python3 - - name: atlas-connect-rhel8-python3.13 - tasks: - - name: .atlas_connect - display_name: Atlas connect RHEL8 Python3.13 - run_on: - - rhel87-small - expansions: - PYTHON_BINARY: /opt/python/3.13/bin/python3 # Atlas data lake tests - name: atlas-data-lake-ubuntu-22-python3.9 diff --git a/.evergreen/scripts/generate_config.py b/.evergreen/scripts/generate_config.py index e99a9a3980..403723a1cd 100644 --- a/.evergreen/scripts/generate_config.py +++ b/.evergreen/scripts/generate_config.py @@ -475,14 +475,12 @@ def create_doctests_variants(): def create_atlas_connect_variants(): host = DEFAULT_HOST - return [ + [ create_variant( - [".atlas_connect"], - get_variant_name("Atlas connect", host, python=python), - python=python, - host=host, + [".min-max-python"], + get_variant_name("Atlas connect", host), + host=DEFAULT_HOST, ) - for python in MIN_MAX_PYTHON ] @@ -663,6 +661,34 @@ def create_server_tasks(): return tasks +def create_min_max_tasks(): + tasks = [] + versions = [ALL_VERSIONS[0], ALL_VERSIONS[-1]] + pythons = [*MIN_MAX_PYTHON, PYPYS[-1]] + topologies = ["standalone", "sharded_cluster", "replica_set"] + for version, python, topology in zip_cycle(versions, pythons, topologies): + auth = "auth" if topology == "sharded_cluster" else "noauth" + ssl = "nossl" if topology == "standalone" else "ssl" + tags = [ + "min-max-tests", + f"server-{version}", + f"python-{python}", + f"{topology}-{auth}-{ssl}", + ] + if "pypy" in python: + tags.append("pypy") + expansions = dict(AUTH=auth, SSL=ssl, TOPOLOGY=topology, VERSION=version) + name = get_task_name("test", python=python, **expansions) + assume_func = FunctionCall(func="assume ec2 role") + server_func = FunctionCall(func="run server", vars=expansions) + test_vars = expansions.copy() + test_vars["PYTHON_VERSION"] = python + test_func = FunctionCall(func="run tests", vars=test_vars) + commands = [assume_func, server_func, test_func] + tasks.append(EvgTask(name=name, tags=tags, commands=commands)) + return tasks + + def create_load_balancer_tasks(): tasks = [] for (auth, ssl), version in product(AUTH_SSLS, get_versions_from("6.0")): @@ -854,15 +880,6 @@ def create_search_index_tasks(): return [EvgTask(name=task_name, tags=tags, commands=commands)] -def create_atlas_connect_tasks(): - vars = dict(TEST_NAME="atlas_connect") - assume_func = FunctionCall(func="assume ec2 role") - test_func = FunctionCall(func="run tests", vars=vars) - task_name = "test-atlas-connect" - tags = ["atlas_connect"] - return [EvgTask(name=task_name, tags=tags, commands=[assume_func, test_func])] - - def create_enterprise_auth_tasks(): tasks = [] for python in [*MIN_MAX_PYTHON, PYPYS[-1]]: From d027dab8d496cc32c4e276aec29afba304450bba Mon Sep 17 00:00:00 2001 From: Steven Silvester Date: Mon, 14 Apr 2025 10:13:49 -0500 Subject: [PATCH 02/16] fix handling --- .evergreen/generated_configs/variants.yml | 6 ++++++ .evergreen/scripts/generate_config.py | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/.evergreen/generated_configs/variants.yml b/.evergreen/generated_configs/variants.yml index 0a51eec9d6..7720e00638 100644 --- a/.evergreen/generated_configs/variants.yml +++ b/.evergreen/generated_configs/variants.yml @@ -59,6 +59,12 @@ buildvariants: NO_EXT: "1" # Atlas connect tests + - name: atlas-connect-rhel8 + tasks: + - name: .min-max-python + display_name: Atlas connect RHEL8 + run_on: + - rhel87-small # Atlas data lake tests - name: atlas-data-lake-ubuntu-22-python3.9 diff --git a/.evergreen/scripts/generate_config.py b/.evergreen/scripts/generate_config.py index 403723a1cd..26213b3c62 100644 --- a/.evergreen/scripts/generate_config.py +++ b/.evergreen/scripts/generate_config.py @@ -475,7 +475,7 @@ def create_doctests_variants(): def create_atlas_connect_variants(): host = DEFAULT_HOST - [ + return [ create_variant( [".min-max-python"], get_variant_name("Atlas connect", host), From 38c43dd21e51853f6c546971d34d0f9665971d6d Mon Sep 17 00:00:00 2001 From: Steven Silvester Date: Mon, 14 Apr 2025 10:14:31 -0500 Subject: [PATCH 03/16] fix variant --- .evergreen/generated_configs/variants.yml | 2 +- .evergreen/scripts/generate_config.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.evergreen/generated_configs/variants.yml b/.evergreen/generated_configs/variants.yml index 7720e00638..663a16309f 100644 --- a/.evergreen/generated_configs/variants.yml +++ b/.evergreen/generated_configs/variants.yml @@ -61,7 +61,7 @@ buildvariants: # Atlas connect tests - name: atlas-connect-rhel8 tasks: - - name: .min-max-python + - name: .min-max-tests display_name: Atlas connect RHEL8 run_on: - rhel87-small diff --git a/.evergreen/scripts/generate_config.py b/.evergreen/scripts/generate_config.py index 26213b3c62..da3310b368 100644 --- a/.evergreen/scripts/generate_config.py +++ b/.evergreen/scripts/generate_config.py @@ -477,7 +477,7 @@ def create_atlas_connect_variants(): host = DEFAULT_HOST return [ create_variant( - [".min-max-python"], + [".min-max-tests"], get_variant_name("Atlas connect", host), host=DEFAULT_HOST, ) From 276e5a74ce75b571e30d959cbf979b330c559dc8 Mon Sep 17 00:00:00 2001 From: Steven Silvester Date: Mon, 14 Apr 2025 10:16:06 -0500 Subject: [PATCH 04/16] add STABLE_VERSION --- .evergreen/generated_configs/tasks.yml | 10 ++++++---- .evergreen/scripts/generate_config.py | 3 ++- .evergreen/scripts/generate_config_utils.py | 1 + 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/.evergreen/generated_configs/tasks.yml b/.evergreen/generated_configs/tasks.yml index f5de4ab80b..1b76936ef2 100644 --- a/.evergreen/generated_configs/tasks.yml +++ b/.evergreen/generated_configs/tasks.yml @@ -1200,7 +1200,7 @@ tasks: - server-latest - python-3.13 - sharded_cluster-auth-ssl - - name: test-v4.0-pypy3.10-noauth-ssl-replica-set + - name: test-v['8.0']-pypy3.10-noauth-ssl-replica-set commands: - func: assume ec2 role - func: run server @@ -1208,17 +1208,19 @@ tasks: AUTH: noauth SSL: ssl TOPOLOGY: replica_set - VERSION: "4.0" + VERSION: + - "8.0" - func: run tests vars: AUTH: noauth SSL: ssl TOPOLOGY: replica_set - VERSION: "4.0" + VERSION: + - "8.0" PYTHON_VERSION: pypy3.10 tags: - min-max-tests - - server-4.0 + - server-['8.0'] - python-pypy3.10 - replica_set-noauth-ssl - pypy diff --git a/.evergreen/scripts/generate_config.py b/.evergreen/scripts/generate_config.py index da3310b368..7329385d08 100644 --- a/.evergreen/scripts/generate_config.py +++ b/.evergreen/scripts/generate_config.py @@ -16,6 +16,7 @@ MIN_MAX_PYTHON, OTHER_HOSTS, PYPYS, + STABLE_VERSION, SUB_TASKS, SYNCS, TOPOLOGIES, @@ -663,7 +664,7 @@ def create_server_tasks(): def create_min_max_tasks(): tasks = [] - versions = [ALL_VERSIONS[0], ALL_VERSIONS[-1]] + versions = [ALL_VERSIONS[0], ALL_VERSIONS[-1], STABLE_VERSION] pythons = [*MIN_MAX_PYTHON, PYPYS[-1]] topologies = ["standalone", "sharded_cluster", "replica_set"] for version, python, topology in zip_cycle(versions, pythons, topologies): diff --git a/.evergreen/scripts/generate_config_utils.py b/.evergreen/scripts/generate_config_utils.py index aa43af9a68..456656daa8 100644 --- a/.evergreen/scripts/generate_config_utils.py +++ b/.evergreen/scripts/generate_config_utils.py @@ -22,6 +22,7 @@ ############## ALL_VERSIONS = ["4.0", "4.2", "4.4", "5.0", "6.0", "7.0", "8.0", "rapid", "latest"] +STABLE_VERSION = ["8.0"] CPYTHONS = ["3.9", "3.10", "3.11", "3.12", "3.13"] PYPYS = ["pypy3.10"] ALL_PYTHONS = CPYTHONS + PYPYS From 2b57f8af5025c5c7d092383540ce0e6d3de45da1 Mon Sep 17 00:00:00 2001 From: Steven Silvester Date: Mon, 14 Apr 2025 10:16:58 -0500 Subject: [PATCH 05/16] add STABLE_VERSION --- .evergreen/generated_configs/tasks.yml | 10 ++++------ .evergreen/scripts/generate_config_utils.py | 2 +- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/.evergreen/generated_configs/tasks.yml b/.evergreen/generated_configs/tasks.yml index 1b76936ef2..abd0bb03e9 100644 --- a/.evergreen/generated_configs/tasks.yml +++ b/.evergreen/generated_configs/tasks.yml @@ -1200,7 +1200,7 @@ tasks: - server-latest - python-3.13 - sharded_cluster-auth-ssl - - name: test-v['8.0']-pypy3.10-noauth-ssl-replica-set + - name: test-v8.0-pypy3.10-noauth-ssl-replica-set commands: - func: assume ec2 role - func: run server @@ -1208,19 +1208,17 @@ tasks: AUTH: noauth SSL: ssl TOPOLOGY: replica_set - VERSION: - - "8.0" + VERSION: "8.0" - func: run tests vars: AUTH: noauth SSL: ssl TOPOLOGY: replica_set - VERSION: - - "8.0" + VERSION: "8.0" PYTHON_VERSION: pypy3.10 tags: - min-max-tests - - server-['8.0'] + - server-8.0 - python-pypy3.10 - replica_set-noauth-ssl - pypy diff --git a/.evergreen/scripts/generate_config_utils.py b/.evergreen/scripts/generate_config_utils.py index 456656daa8..d102972eb8 100644 --- a/.evergreen/scripts/generate_config_utils.py +++ b/.evergreen/scripts/generate_config_utils.py @@ -22,7 +22,7 @@ ############## ALL_VERSIONS = ["4.0", "4.2", "4.4", "5.0", "6.0", "7.0", "8.0", "rapid", "latest"] -STABLE_VERSION = ["8.0"] +STABLE_VERSION = "8.0" CPYTHONS = ["3.9", "3.10", "3.11", "3.12", "3.13"] PYPYS = ["pypy3.10"] ALL_PYTHONS = CPYTHONS + PYPYS From 454a480ec73ea2e7f77cd5df7f74a31bf73fe8de Mon Sep 17 00:00:00 2001 From: Steven Silvester Date: Mon, 14 Apr 2025 10:20:02 -0500 Subject: [PATCH 06/16] cleanup --- .evergreen/generated_configs/tasks.yml | 55 +++------------------ .evergreen/generated_configs/variants.yml | 2 +- .evergreen/scripts/generate_config.py | 23 +++------ .evergreen/scripts/generate_config_utils.py | 1 - 4 files changed, 13 insertions(+), 68 deletions(-) diff --git a/.evergreen/generated_configs/tasks.yml b/.evergreen/generated_configs/tasks.yml index abd0bb03e9..6f2b5ad46c 100644 --- a/.evergreen/generated_configs/tasks.yml +++ b/.evergreen/generated_configs/tasks.yml @@ -1158,70 +1158,27 @@ tasks: tags: [load-balancer, noauth, nossl] # Min max tests - - name: test-v4.0-python3.9-noauth-nossl-standalone + - name: test-python3.9 commands: - func: assume ec2 role - - func: run server - vars: - AUTH: noauth - SSL: nossl - TOPOLOGY: standalone - VERSION: "4.0" - func: run tests vars: - AUTH: noauth - SSL: nossl - TOPOLOGY: standalone - VERSION: "4.0" PYTHON_VERSION: "3.9" - tags: - - min-max-tests - - server-4.0 - - python-3.9 - - standalone-noauth-nossl - - name: test-latest-python3.13-auth-ssl-sharded-cluster + tags: [min-max-python, python-3.9] + - name: test-python3.13 commands: - func: assume ec2 role - - func: run server - vars: - AUTH: auth - SSL: ssl - TOPOLOGY: sharded_cluster - VERSION: latest - func: run tests vars: - AUTH: auth - SSL: ssl - TOPOLOGY: sharded_cluster - VERSION: latest PYTHON_VERSION: "3.13" - tags: - - min-max-tests - - server-latest - - python-3.13 - - sharded_cluster-auth-ssl - - name: test-v8.0-pypy3.10-noauth-ssl-replica-set + tags: [min-max-python, python-3.13] + - name: test-pypy3.10 commands: - func: assume ec2 role - - func: run server - vars: - AUTH: noauth - SSL: ssl - TOPOLOGY: replica_set - VERSION: "8.0" - func: run tests vars: - AUTH: noauth - SSL: ssl - TOPOLOGY: replica_set - VERSION: "8.0" PYTHON_VERSION: pypy3.10 - tags: - - min-max-tests - - server-8.0 - - python-pypy3.10 - - replica_set-noauth-ssl - - pypy + tags: [min-max-python, python-pypy3.10, pypy] # Mockupdb tests - name: test-mockupdb diff --git a/.evergreen/generated_configs/variants.yml b/.evergreen/generated_configs/variants.yml index 663a16309f..7720e00638 100644 --- a/.evergreen/generated_configs/variants.yml +++ b/.evergreen/generated_configs/variants.yml @@ -61,7 +61,7 @@ buildvariants: # Atlas connect tests - name: atlas-connect-rhel8 tasks: - - name: .min-max-tests + - name: .min-max-python display_name: Atlas connect RHEL8 run_on: - rhel87-small diff --git a/.evergreen/scripts/generate_config.py b/.evergreen/scripts/generate_config.py index 7329385d08..564cc5d9bc 100644 --- a/.evergreen/scripts/generate_config.py +++ b/.evergreen/scripts/generate_config.py @@ -16,7 +16,6 @@ MIN_MAX_PYTHON, OTHER_HOSTS, PYPYS, - STABLE_VERSION, SUB_TASKS, SYNCS, TOPOLOGIES, @@ -478,7 +477,7 @@ def create_atlas_connect_variants(): host = DEFAULT_HOST return [ create_variant( - [".min-max-tests"], + [".min-max-python"], get_variant_name("Atlas connect", host), host=DEFAULT_HOST, ) @@ -664,28 +663,18 @@ def create_server_tasks(): def create_min_max_tasks(): tasks = [] - versions = [ALL_VERSIONS[0], ALL_VERSIONS[-1], STABLE_VERSION] - pythons = [*MIN_MAX_PYTHON, PYPYS[-1]] - topologies = ["standalone", "sharded_cluster", "replica_set"] - for version, python, topology in zip_cycle(versions, pythons, topologies): - auth = "auth" if topology == "sharded_cluster" else "noauth" - ssl = "nossl" if topology == "standalone" else "ssl" + for python in [*MIN_MAX_PYTHON, PYPYS[-1]]: tags = [ - "min-max-tests", - f"server-{version}", + "min-max-python", f"python-{python}", - f"{topology}-{auth}-{ssl}", ] if "pypy" in python: tags.append("pypy") - expansions = dict(AUTH=auth, SSL=ssl, TOPOLOGY=topology, VERSION=version) - name = get_task_name("test", python=python, **expansions) + name = get_task_name("test", python=python) assume_func = FunctionCall(func="assume ec2 role") - server_func = FunctionCall(func="run server", vars=expansions) - test_vars = expansions.copy() - test_vars["PYTHON_VERSION"] = python + test_vars = dict(PYTHON_VERSION=python) test_func = FunctionCall(func="run tests", vars=test_vars) - commands = [assume_func, server_func, test_func] + commands = [assume_func, test_func] tasks.append(EvgTask(name=name, tags=tags, commands=commands)) return tasks diff --git a/.evergreen/scripts/generate_config_utils.py b/.evergreen/scripts/generate_config_utils.py index d102972eb8..aa43af9a68 100644 --- a/.evergreen/scripts/generate_config_utils.py +++ b/.evergreen/scripts/generate_config_utils.py @@ -22,7 +22,6 @@ ############## ALL_VERSIONS = ["4.0", "4.2", "4.4", "5.0", "6.0", "7.0", "8.0", "rapid", "latest"] -STABLE_VERSION = "8.0" CPYTHONS = ["3.9", "3.10", "3.11", "3.12", "3.13"] PYPYS = ["pypy3.10"] ALL_PYTHONS = CPYTHONS + PYPYS From 139599b2c0df579f9c18149d21a7eccd3316f46c Mon Sep 17 00:00:00 2001 From: Steven Silvester Date: Mon, 14 Apr 2025 10:21:45 -0500 Subject: [PATCH 07/16] cleanup --- .evergreen/generated_configs/tasks.yml | 46 +++++++++++------------ .evergreen/generated_configs/variants.yml | 2 +- .evergreen/scripts/generate_config.py | 10 ++--- 3 files changed, 28 insertions(+), 30 deletions(-) diff --git a/.evergreen/generated_configs/tasks.yml b/.evergreen/generated_configs/tasks.yml index 6f2b5ad46c..73eb36f44d 100644 --- a/.evergreen/generated_configs/tasks.yml +++ b/.evergreen/generated_configs/tasks.yml @@ -1157,29 +1157,6 @@ tasks: TEST_NAME: load_balancer tags: [load-balancer, noauth, nossl] - # Min max tests - - name: test-python3.9 - commands: - - func: assume ec2 role - - func: run tests - vars: - PYTHON_VERSION: "3.9" - tags: [min-max-python, python-3.9] - - name: test-python3.13 - commands: - - func: assume ec2 role - - func: run tests - vars: - PYTHON_VERSION: "3.13" - tags: [min-max-python, python-3.13] - - name: test-pypy3.10 - commands: - - func: assume ec2 role - - func: run tests - vars: - PYTHON_VERSION: pypy3.10 - tags: [min-max-python, python-pypy3.10, pypy] - # Mockupdb tests - name: test-mockupdb commands: @@ -1230,6 +1207,29 @@ tasks: SUB_TEST_NAME: embedded tags: [mod_wsgi] + # No local server tests + - name: test-no-local-server-python3.9 + commands: + - func: assume ec2 role + - func: run tests + vars: + PYTHON_VERSION: "3.9" + tags: [no-local-server, python-3.9] + - name: test-no-local-server-python3.13 + commands: + - func: assume ec2 role + - func: run tests + vars: + PYTHON_VERSION: "3.13" + tags: [no-local-server, python-3.13] + - name: test-no-local-server-pypy3.10 + commands: + - func: assume ec2 role + - func: run tests + vars: + PYTHON_VERSION: pypy3.10 + tags: [no-local-server, python-pypy3.10] + # No server tests - name: test-no-server commands: diff --git a/.evergreen/generated_configs/variants.yml b/.evergreen/generated_configs/variants.yml index 7720e00638..15f48fccbd 100644 --- a/.evergreen/generated_configs/variants.yml +++ b/.evergreen/generated_configs/variants.yml @@ -61,7 +61,7 @@ buildvariants: # Atlas connect tests - name: atlas-connect-rhel8 tasks: - - name: .min-max-python + - name: .no-local-server display_name: Atlas connect RHEL8 run_on: - rhel87-small diff --git a/.evergreen/scripts/generate_config.py b/.evergreen/scripts/generate_config.py index 564cc5d9bc..f1014c5de3 100644 --- a/.evergreen/scripts/generate_config.py +++ b/.evergreen/scripts/generate_config.py @@ -477,7 +477,7 @@ def create_atlas_connect_variants(): host = DEFAULT_HOST return [ create_variant( - [".min-max-python"], + [".no-local-server"], get_variant_name("Atlas connect", host), host=DEFAULT_HOST, ) @@ -661,16 +661,14 @@ def create_server_tasks(): return tasks -def create_min_max_tasks(): +def create_no_local_server_tasks(): tasks = [] for python in [*MIN_MAX_PYTHON, PYPYS[-1]]: tags = [ - "min-max-python", + "no-local-server", f"python-{python}", ] - if "pypy" in python: - tags.append("pypy") - name = get_task_name("test", python=python) + name = get_task_name("test-no-local-server", python=python) assume_func = FunctionCall(func="assume ec2 role") test_vars = dict(PYTHON_VERSION=python) test_func = FunctionCall(func="run tests", vars=test_vars) From 2489651f560bf339001f209791d34d02490c7441 Mon Sep 17 00:00:00 2001 From: Steven Silvester Date: Mon, 14 Apr 2025 10:24:53 -0500 Subject: [PATCH 08/16] update data lake tests --- .evergreen/generated_configs/tasks.yml | 15 --------------- .evergreen/generated_configs/variants.yml | 6 ++++-- .evergreen/scripts/generate_config.py | 19 +++++-------------- 3 files changed, 9 insertions(+), 31 deletions(-) diff --git a/.evergreen/generated_configs/tasks.yml b/.evergreen/generated_configs/tasks.yml index 73eb36f44d..8a3988de41 100644 --- a/.evergreen/generated_configs/tasks.yml +++ b/.evergreen/generated_configs/tasks.yml @@ -1,19 +1,4 @@ tasks: - # Atlas data lake tests - - name: test-atlas-data-lake-without_ext - commands: - - func: run tests - vars: - TEST_NAME: data_lake - NO_EXT: "1" - tags: [atlas_data_lake] - - name: test-atlas-data-lake-with_ext - commands: - - func: run tests - vars: - TEST_NAME: data_lake - tags: [atlas_data_lake] - # Aws lambda tests - name: test-aws-lambda-deployed commands: diff --git a/.evergreen/generated_configs/variants.yml b/.evergreen/generated_configs/variants.yml index 15f48fccbd..a5070d8f7c 100644 --- a/.evergreen/generated_configs/variants.yml +++ b/.evergreen/generated_configs/variants.yml @@ -69,19 +69,21 @@ buildvariants: # Atlas data lake tests - name: atlas-data-lake-ubuntu-22-python3.9 tasks: - - name: .atlas_data_lake + - name: .no-local-server display_name: Atlas Data Lake Ubuntu-22 Python3.9 run_on: - ubuntu2204-small expansions: + TEST_NAME: data_lake PYTHON_BINARY: /opt/python/3.9/bin/python3 - name: atlas-data-lake-ubuntu-22-python3.13 tasks: - - name: .atlas_data_lake + - name: .no-local-server display_name: Atlas Data Lake Ubuntu-22 Python3.13 run_on: - ubuntu2204-small expansions: + TEST_NAME: data_lake PYTHON_BINARY: /opt/python/3.13/bin/python3 # Aws auth tests diff --git a/.evergreen/scripts/generate_config.py b/.evergreen/scripts/generate_config.py index f1014c5de3..db752135b0 100644 --- a/.evergreen/scripts/generate_config.py +++ b/.evergreen/scripts/generate_config.py @@ -368,9 +368,12 @@ def create_atlas_data_lake_variants(): variants = [] host = HOSTS["ubuntu22"] for python in MIN_MAX_PYTHON: - tasks = [".atlas_data_lake"] + tasks = [".no-local-server"] + expansions = dict(TEST_NAME="data_lake") display_name = get_variant_name("Atlas Data Lake", host, python=python) - variant = create_variant(tasks, display_name, host=host, python=python) + variant = create_variant( + tasks, display_name, host=host, python=python, expansions=expansions + ) variants.append(variant) return variants @@ -905,18 +908,6 @@ def create_perf_tasks(): return tasks -def create_atlas_data_lake_tasks(): - tags = ["atlas_data_lake"] - tasks = [] - for c_ext in C_EXTS: - vars = dict(TEST_NAME="data_lake") - handle_c_ext(c_ext, vars) - test_func = FunctionCall(func="run tests", vars=vars) - task_name = f"test-atlas-data-lake-{c_ext}" - tasks.append(EvgTask(name=task_name, tags=tags, commands=[test_func])) - return tasks - - def create_getdata_tasks(): # Wildcard task. Do you need to find out what tools are available and where? # Throw it here, and execute this task on all buildvariants From a8a2832de1259e9a97c2cc342848725bf55c988e Mon Sep 17 00:00:00 2001 From: Steven Silvester Date: Mon, 14 Apr 2025 10:25:51 -0500 Subject: [PATCH 09/16] update data lake tests --- .evergreen/generated_configs/variants.yml | 14 ++------------ .evergreen/scripts/generate_config.py | 14 ++++---------- 2 files changed, 6 insertions(+), 22 deletions(-) diff --git a/.evergreen/generated_configs/variants.yml b/.evergreen/generated_configs/variants.yml index a5070d8f7c..05ba65f930 100644 --- a/.evergreen/generated_configs/variants.yml +++ b/.evergreen/generated_configs/variants.yml @@ -67,24 +67,14 @@ buildvariants: - rhel87-small # Atlas data lake tests - - name: atlas-data-lake-ubuntu-22-python3.9 + - name: atlas-data-lake-ubuntu-22 tasks: - name: .no-local-server - display_name: Atlas Data Lake Ubuntu-22 Python3.9 + display_name: Atlas Data Lake Ubuntu-22 run_on: - ubuntu2204-small expansions: TEST_NAME: data_lake - PYTHON_BINARY: /opt/python/3.9/bin/python3 - - name: atlas-data-lake-ubuntu-22-python3.13 - tasks: - - name: .no-local-server - display_name: Atlas Data Lake Ubuntu-22 Python3.13 - run_on: - - ubuntu2204-small - expansions: - TEST_NAME: data_lake - PYTHON_BINARY: /opt/python/3.13/bin/python3 # Aws auth tests - name: auth-aws-ubuntu-20-python3.9 diff --git a/.evergreen/scripts/generate_config.py b/.evergreen/scripts/generate_config.py index db752135b0..c6418b9ec6 100644 --- a/.evergreen/scripts/generate_config.py +++ b/.evergreen/scripts/generate_config.py @@ -365,17 +365,11 @@ def create_no_c_ext_variants(): def create_atlas_data_lake_variants(): - variants = [] host = HOSTS["ubuntu22"] - for python in MIN_MAX_PYTHON: - tasks = [".no-local-server"] - expansions = dict(TEST_NAME="data_lake") - display_name = get_variant_name("Atlas Data Lake", host, python=python) - variant = create_variant( - tasks, display_name, host=host, python=python, expansions=expansions - ) - variants.append(variant) - return variants + tasks = [".no-local-server"] + expansions = dict(TEST_NAME="data_lake") + display_name = get_variant_name("Atlas Data Lake", host) + return [create_variant(tasks, display_name, host=host, expansions=expansions)] def create_mod_wsgi_variants(): From c74b25424e6e12c3a00c4add5f995eeda1627aa7 Mon Sep 17 00:00:00 2001 From: Steven Silvester Date: Mon, 14 Apr 2025 10:28:17 -0500 Subject: [PATCH 10/16] update mockupdb --- .evergreen/generated_configs/tasks.yml | 8 -------- .evergreen/generated_configs/variants.yml | 8 ++++---- .evergreen/scripts/generate_config.py | 15 ++++----------- 3 files changed, 8 insertions(+), 23 deletions(-) diff --git a/.evergreen/generated_configs/tasks.yml b/.evergreen/generated_configs/tasks.yml index 8a3988de41..caaf87bd59 100644 --- a/.evergreen/generated_configs/tasks.yml +++ b/.evergreen/generated_configs/tasks.yml @@ -1142,14 +1142,6 @@ tasks: TEST_NAME: load_balancer tags: [load-balancer, noauth, nossl] - # Mockupdb tests - - name: test-mockupdb - commands: - - func: run tests - vars: - TEST_NAME: mockupdb - tags: [mockupdb] - # Mod wsgi tests - name: mod-wsgi-standalone commands: diff --git a/.evergreen/generated_configs/variants.yml b/.evergreen/generated_configs/variants.yml index 05ba65f930..f6530b9a61 100644 --- a/.evergreen/generated_configs/variants.yml +++ b/.evergreen/generated_configs/variants.yml @@ -567,14 +567,14 @@ buildvariants: batchtime: 10080 # Mockupdb tests - - name: mockupdb-rhel8-python3.9 + - name: mockupdb-rhel8 tasks: - - name: .mockupdb - display_name: MockupDB RHEL8 Python3.9 + - name: .no-local-server + display_name: MockupDB RHEL8 run_on: - rhel87-small expansions: - PYTHON_BINARY: /opt/python/3.9/bin/python3 + TEST_NAME: mockupdb # Mod wsgi tests - name: mod_wsgi-ubuntu-22-python3.9 diff --git a/.evergreen/scripts/generate_config.py b/.evergreen/scripts/generate_config.py index c6418b9ec6..5a5675b102 100644 --- a/.evergreen/scripts/generate_config.py +++ b/.evergreen/scripts/generate_config.py @@ -446,13 +446,13 @@ def create_search_index_variants(): def create_mockupdb_variants(): host = DEFAULT_HOST - python = CPYTHONS[0] + expansions = dict(TEST_NAME="mockupdb") return [ create_variant( - [".mockupdb"], - get_variant_name("MockupDB", host, python=python), - python=python, + [".no-local-server"], + get_variant_name("MockupDB", host), host=host, + expansions=expansions, ) ] @@ -981,13 +981,6 @@ def create_ocsp_tasks(): return tasks -def create_mockupdb_tasks(): - test_func = FunctionCall(func="run tests", vars=dict(TEST_NAME="mockupdb")) - task_name = "test-mockupdb" - tags = ["mockupdb"] - return [EvgTask(name=task_name, tags=tags, commands=[test_func])] - - def create_doctest_tasks(): server_func = FunctionCall(func="run server") test_func = FunctionCall(func="run just script", vars=dict(JUSTFILE_TARGET="docs-test")) From 1df98ceff5c6db7fd190e911fe7b2f9a24184312 Mon Sep 17 00:00:00 2001 From: Steven Silvester Date: Mon, 14 Apr 2025 10:29:30 -0500 Subject: [PATCH 11/16] update no server --- .evergreen/generated_configs/tasks.yml | 6 ------ .evergreen/generated_configs/variants.yml | 2 +- .evergreen/scripts/generate_config.py | 9 +-------- 3 files changed, 2 insertions(+), 15 deletions(-) diff --git a/.evergreen/generated_configs/tasks.yml b/.evergreen/generated_configs/tasks.yml index caaf87bd59..d95d1d2ee6 100644 --- a/.evergreen/generated_configs/tasks.yml +++ b/.evergreen/generated_configs/tasks.yml @@ -1207,12 +1207,6 @@ tasks: PYTHON_VERSION: pypy3.10 tags: [no-local-server, python-pypy3.10] - # No server tests - - name: test-no-server - commands: - - func: run tests - tags: [no-server] - # Ocsp tests - name: test-ocsp-ecdsa-valid-cert-server-does-not-staple-v4.4-python3.9 commands: diff --git a/.evergreen/generated_configs/variants.yml b/.evergreen/generated_configs/variants.yml index f6530b9a61..96275965dd 100644 --- a/.evergreen/generated_configs/variants.yml +++ b/.evergreen/generated_configs/variants.yml @@ -646,7 +646,7 @@ buildvariants: # No server tests - name: no-server tasks: - - name: .no-server + - name: .no-local-server display_name: No server run_on: - rhel87-small diff --git a/.evergreen/scripts/generate_config.py b/.evergreen/scripts/generate_config.py index 5a5675b102..60b0340ab9 100644 --- a/.evergreen/scripts/generate_config.py +++ b/.evergreen/scripts/generate_config.py @@ -533,7 +533,7 @@ def create_aws_auth_variants(): def create_no_server_variants(): host = HOSTS["rhel8"] - return [create_variant([".no-server"], "No server", host=host)] + return [create_variant([".no-local-server"], "No server", host=host)] def create_alternative_hosts_variants(): @@ -989,13 +989,6 @@ def create_doctest_tasks(): return [EvgTask(name=task_name, tags=tags, commands=[server_func, test_func])] -def create_no_server_tasks(): - test_func = FunctionCall(func="run tests") - task_name = "test-no-server" - tags = ["no-server"] - return [EvgTask(name=task_name, tags=tags, commands=[test_func])] - - def create_free_threading_tasks(): vars = dict(VERSION="8.0", TOPOLOGY="replica_set") server_func = FunctionCall(func="run server", vars=vars) From bc00e6f518113bc39f6fa46ea2b68c636d7c442b Mon Sep 17 00:00:00 2001 From: Steven Silvester Date: Mon, 14 Apr 2025 10:36:22 -0500 Subject: [PATCH 12/16] update variant name --- .evergreen/generated_configs/variants.yml | 4 ++-- .evergreen/scripts/generate_config.py | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.evergreen/generated_configs/variants.yml b/.evergreen/generated_configs/variants.yml index 96275965dd..8ca858a05d 100644 --- a/.evergreen/generated_configs/variants.yml +++ b/.evergreen/generated_configs/variants.yml @@ -644,10 +644,10 @@ buildvariants: PYTHON_BINARY: /opt/python/3.13/bin/python3 # No server tests - - name: no-server + - name: no-server-rhel8 tasks: - name: .no-local-server - display_name: No server + display_name: No server RHEL8 run_on: - rhel87-small diff --git a/.evergreen/scripts/generate_config.py b/.evergreen/scripts/generate_config.py index 60b0340ab9..d13794e9aa 100644 --- a/.evergreen/scripts/generate_config.py +++ b/.evergreen/scripts/generate_config.py @@ -533,7 +533,8 @@ def create_aws_auth_variants(): def create_no_server_variants(): host = HOSTS["rhel8"] - return [create_variant([".no-local-server"], "No server", host=host)] + name = get_variant_name("No server", host=host) + return [create_variant([".no-local-server"], name, host=host)] def create_alternative_hosts_variants(): From e3d99bdb8db6668f87685165c2cb85befaa34fd6 Mon Sep 17 00:00:00 2001 From: Steven Silvester Date: Mon, 14 Apr 2025 10:41:07 -0500 Subject: [PATCH 13/16] address teardown failures in data lake tests --- test/asynchronous/test_data_lake.py | 3 +++ test/test_data_lake.py | 3 +++ 2 files changed, 6 insertions(+) diff --git a/test/asynchronous/test_data_lake.py b/test/asynchronous/test_data_lake.py index 689bf38534..cacae01dcd 100644 --- a/test/asynchronous/test_data_lake.py +++ b/test/asynchronous/test_data_lake.py @@ -80,17 +80,20 @@ async def test_1(self): self.assertEqual(cursor_ns, target_ns) self.assertIn(cursor_id, succeeded.reply["cursorsKilled"]) + await client.close() # Test no auth async def test_2(self): client = await self.async_rs_client_noauth() await client.admin.command("ping") + await client.close() # Test with auth async def test_3(self): for mechanism in ["SCRAM-SHA-1", "SCRAM-SHA-256"]: client = await self.async_rs_or_single_client(authMechanism=mechanism) await client[self.TEST_DB][self.TEST_COLLECTION].find_one() + await client.close() # Location of JSON test specifications. diff --git a/test/test_data_lake.py b/test/test_data_lake.py index d6d2007007..419dd235e3 100644 --- a/test/test_data_lake.py +++ b/test/test_data_lake.py @@ -80,17 +80,20 @@ def test_1(self): self.assertEqual(cursor_ns, target_ns) self.assertIn(cursor_id, succeeded.reply["cursorsKilled"]) + client.close() # Test no auth def test_2(self): client = self.rs_client_noauth() client.admin.command("ping") + client.close() # Test with auth def test_3(self): for mechanism in ["SCRAM-SHA-1", "SCRAM-SHA-256"]: client = self.rs_or_single_client(authMechanism=mechanism) client[self.TEST_DB][self.TEST_COLLECTION].find_one() + client.close() # Location of JSON test specifications. From 6af4011bcc6851d73cc59be75bb145c994ce0cf2 Mon Sep 17 00:00:00 2001 From: Steven Silvester Date: Mon, 14 Apr 2025 11:02:18 -0500 Subject: [PATCH 14/16] Revert "address teardown failures in data lake tests" This reverts commit e3d99bdb8db6668f87685165c2cb85befaa34fd6. --- test/asynchronous/test_data_lake.py | 3 --- test/test_data_lake.py | 3 --- 2 files changed, 6 deletions(-) diff --git a/test/asynchronous/test_data_lake.py b/test/asynchronous/test_data_lake.py index cacae01dcd..689bf38534 100644 --- a/test/asynchronous/test_data_lake.py +++ b/test/asynchronous/test_data_lake.py @@ -80,20 +80,17 @@ async def test_1(self): self.assertEqual(cursor_ns, target_ns) self.assertIn(cursor_id, succeeded.reply["cursorsKilled"]) - await client.close() # Test no auth async def test_2(self): client = await self.async_rs_client_noauth() await client.admin.command("ping") - await client.close() # Test with auth async def test_3(self): for mechanism in ["SCRAM-SHA-1", "SCRAM-SHA-256"]: client = await self.async_rs_or_single_client(authMechanism=mechanism) await client[self.TEST_DB][self.TEST_COLLECTION].find_one() - await client.close() # Location of JSON test specifications. diff --git a/test/test_data_lake.py b/test/test_data_lake.py index 419dd235e3..d6d2007007 100644 --- a/test/test_data_lake.py +++ b/test/test_data_lake.py @@ -80,20 +80,17 @@ def test_1(self): self.assertEqual(cursor_ns, target_ns) self.assertIn(cursor_id, succeeded.reply["cursorsKilled"]) - client.close() # Test no auth def test_2(self): client = self.rs_client_noauth() client.admin.command("ping") - client.close() # Test with auth def test_3(self): for mechanism in ["SCRAM-SHA-1", "SCRAM-SHA-256"]: client = self.rs_or_single_client(authMechanism=mechanism) client[self.TEST_DB][self.TEST_COLLECTION].find_one() - client.close() # Location of JSON test specifications. From 9587ec533ae41df51ba1bb3086358f986c9a2b7c Mon Sep 17 00:00:00 2001 From: Steven Silvester Date: Mon, 14 Apr 2025 11:13:12 -0500 Subject: [PATCH 15/16] address teardown failures in data lake tests --- test/__init__.py | 1 + test/asynchronous/__init__.py | 1 + 2 files changed, 2 insertions(+) diff --git a/test/__init__.py b/test/__init__.py index a1c5091f3b..f0b5e2a416 100644 --- a/test/__init__.py +++ b/test/__init__.py @@ -1189,6 +1189,7 @@ def setUp(self) -> None: if client_context.serverless and not getattr(self, "RUN_ON_SERVERLESS", False): raise SkipTest("this test does not support serverless") self.client = client_context.client + self.addCleanup(self.client.close) self.db = self.client.pymongo_test if client_context.auth_enabled: self.credentials = {"username": db_user, "password": db_pwd} diff --git a/test/asynchronous/__init__.py b/test/asynchronous/__init__.py index f8d04f0d5d..5abf36f83d 100644 --- a/test/asynchronous/__init__.py +++ b/test/asynchronous/__init__.py @@ -1207,6 +1207,7 @@ async def asyncSetUp(self) -> None: if async_client_context.serverless and not getattr(self, "RUN_ON_SERVERLESS", False): raise SkipTest("this test does not support serverless") self.client = async_client_context.client + self.addAsyncCleanup(self.client.close) self.db = self.client.pymongo_test if async_client_context.auth_enabled: self.credentials = {"username": db_user, "password": db_pwd} From a0b5e35bacac81cb3466df649b6231beb6cdf973 Mon Sep 17 00:00:00 2001 From: Steven Silvester Date: Mon, 14 Apr 2025 11:18:50 -0500 Subject: [PATCH 16/16] address teardown failures in data lake tests --- test/__init__.py | 2 +- test/asynchronous/__init__.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/test/__init__.py b/test/__init__.py index f0b5e2a416..7ae3432062 100644 --- a/test/__init__.py +++ b/test/__init__.py @@ -206,6 +206,7 @@ def _init_client(self): if os.environ.get("TEST_DATA_LAKE"): self.is_data_lake = True self.auth_enabled = True + self.client.close() self.client = self._connect(host, port, username=db_user, password=db_pwd) self.connected = True return @@ -1189,7 +1190,6 @@ def setUp(self) -> None: if client_context.serverless and not getattr(self, "RUN_ON_SERVERLESS", False): raise SkipTest("this test does not support serverless") self.client = client_context.client - self.addCleanup(self.client.close) self.db = self.client.pymongo_test if client_context.auth_enabled: self.credentials = {"username": db_user, "password": db_pwd} diff --git a/test/asynchronous/__init__.py b/test/asynchronous/__init__.py index 5abf36f83d..c57bf2a880 100644 --- a/test/asynchronous/__init__.py +++ b/test/asynchronous/__init__.py @@ -206,6 +206,7 @@ async def _init_client(self): if os.environ.get("TEST_DATA_LAKE"): self.is_data_lake = True self.auth_enabled = True + await self.client.close() self.client = await self._connect(host, port, username=db_user, password=db_pwd) self.connected = True return @@ -1207,7 +1208,6 @@ async def asyncSetUp(self) -> None: if async_client_context.serverless and not getattr(self, "RUN_ON_SERVERLESS", False): raise SkipTest("this test does not support serverless") self.client = async_client_context.client - self.addAsyncCleanup(self.client.close) self.db = self.client.pymongo_test if async_client_context.auth_enabled: self.credentials = {"username": db_user, "password": db_pwd}