From 20fa7ceb4cce99a98f5a104a22618bd9b3695dc0 Mon Sep 17 00:00:00 2001 From: Steven Silvester Date: Fri, 2 Oct 2026 06:32:49 -0500 Subject: [PATCH 1/3] PYTHON-6104 [v4.18] Remove mod_wsgi testing from Evergreen --- .evergreen/generated_configs/tasks.yml | 62 ----------------------- .evergreen/generated_configs/variants.yml | 10 ---- .evergreen/scripts/generate_config.py | 33 ------------ test/mod_wsgi_test/README.rst | 9 ++-- 4 files changed, 5 insertions(+), 109 deletions(-) diff --git a/.evergreen/generated_configs/tasks.yml b/.evergreen/generated_configs/tasks.yml index 94404d7828..f47c19ce1e 100644 --- a/.evergreen/generated_configs/tasks.yml +++ b/.evergreen/generated_configs/tasks.yml @@ -317,68 +317,6 @@ tasks: TOPOLOGY: sharded_cluster tags: [test-min-support] - # Mod wsgi tests - - name: mod-wsgi-replica-set-python3.10 - commands: - - func: run server - vars: - TOPOLOGY: replica_set - TOOLCHAIN_VERSION: "3.10" - - func: run tests - vars: - TEST_NAME: mod_wsgi - SUB_TEST_NAME: standalone - TOOLCHAIN_VERSION: "3.10" - tags: [mod_wsgi, pr] - - name: mod-wsgi-embedded-mode-replica-set-python3.11 - commands: - - func: run server - vars: - TOPOLOGY: replica_set - TOOLCHAIN_VERSION: "3.11" - - func: run tests - vars: - TEST_NAME: mod_wsgi - SUB_TEST_NAME: embedded - TOOLCHAIN_VERSION: "3.11" - tags: [mod_wsgi, pr] - - name: mod-wsgi-replica-set-python3.12 - commands: - - func: run server - vars: - TOPOLOGY: replica_set - TOOLCHAIN_VERSION: "3.12" - - func: run tests - vars: - TEST_NAME: mod_wsgi - SUB_TEST_NAME: standalone - TOOLCHAIN_VERSION: "3.12" - tags: [mod_wsgi, pr] - - name: mod-wsgi-embedded-mode-replica-set-python3.13 - commands: - - func: run server - vars: - TOPOLOGY: replica_set - TOOLCHAIN_VERSION: "3.13" - - func: run tests - vars: - TEST_NAME: mod_wsgi - SUB_TEST_NAME: embedded - TOOLCHAIN_VERSION: "3.13" - tags: [mod_wsgi, pr] - - name: mod-wsgi-embedded-mode-replica-set-python3.14 - commands: - - func: run server - vars: - TOPOLOGY: replica_set - TOOLCHAIN_VERSION: "3.14" - - func: run tests - vars: - TEST_NAME: mod_wsgi - SUB_TEST_NAME: embedded - TOOLCHAIN_VERSION: "3.14" - tags: [mod_wsgi, pr] - # No orchestration tests - name: test-no-orchestration-python3.10-min-deps commands: diff --git a/.evergreen/generated_configs/variants.yml b/.evergreen/generated_configs/variants.yml index 9fe505c562..35e19b221a 100644 --- a/.evergreen/generated_configs/variants.yml +++ b/.evergreen/generated_configs/variants.yml @@ -361,16 +361,6 @@ buildvariants: TEST_NAME: mockupdb tags: [pr] - # Mod wsgi tests - - name: mod_wsgi-ubuntu-22 - tasks: - - name: .mod_wsgi - display_name: Mod_WSGI Ubuntu-22 - run_on: - - ubuntu2204-small - expansions: - MOD_WSGI_VERSION: "4" - # No c ext tests - name: no-c-ext-rhel8 tasks: diff --git a/.evergreen/scripts/generate_config.py b/.evergreen/scripts/generate_config.py index e99cf23912..d1f4af4133 100644 --- a/.evergreen/scripts/generate_config.py +++ b/.evergreen/scripts/generate_config.py @@ -345,14 +345,6 @@ def create_no_c_ext_variants(): return [create_variant(tasks, display_name, host=host, expansions=expansions)] -def create_mod_wsgi_variants(): - host = HOSTS["ubuntu22"] - tasks = [".mod_wsgi"] - expansions = dict(MOD_WSGI_VERSION="4") - display_name = get_variant_name("Mod_WSGI", host) - return [create_variant(tasks, display_name, host=host, expansions=expansions)] - - def create_disable_test_commands_variants(): host = DEFAULT_HOST expansions = dict(AUTH="auth", SSL="ssl", DISABLE_TEST_COMMANDS="1") @@ -957,31 +949,6 @@ def create_oidc_tasks(): return tasks -def create_mod_wsgi_tasks(): - tasks = [] - for (test, topology), python in zip_cycle( - product(["standalone", "embedded-mode"], ["standalone", "replica_set"]), CPYTHONS - ): - if "t" in python: - continue - if test == "standalone": - task_name = "mod-wsgi-" - else: - task_name = "mod-wsgi-embedded-mode-" - task_name += topology.replace("_", "-") - task_name = get_task_name(task_name, python=python) - server_vars = dict(TOPOLOGY=topology, TOOLCHAIN_VERSION=python) - server_func = FunctionCall(func="run server", vars=server_vars) - vars = dict( - TEST_NAME="mod_wsgi", SUB_TEST_NAME=test.split("-")[0], TOOLCHAIN_VERSION=python - ) - test_func = FunctionCall(func="run tests", vars=vars) - tags = ["mod_wsgi", "pr"] - commands = [server_func, test_func] - tasks.append(EvgTask(name=task_name, tags=tags, commands=commands)) - return tasks - - def _create_ocsp_tasks(algo, variant, server_type, base_task_name): tasks = [] file_name = f"{algo}-basic-tls-ocsp-{variant}.json" diff --git a/test/mod_wsgi_test/README.rst b/test/mod_wsgi_test/README.rst index e96db9406c..615e22d6c0 100644 --- a/test/mod_wsgi_test/README.rst +++ b/test/mod_wsgi_test/README.rst @@ -104,7 +104,8 @@ the workaround added in `PYTHON-569 Automation ---------- -At MongoDB, Inc. we use a continuous integration job that tests each -combination in the matrix. The job starts up Apache, starts a single server -or replica set, and runs ``test_client.py`` with the proper arguments. -See `run-mod-wsgi-tests.sh `_ +The Evergreen configuration no longer runs these tests automatically. They +can be run by hand with the ``mod_wsgi_tester.py`` helper, which starts up +Apache, starts a single server or replica set, and runs ``test_client.py`` +with the proper arguments. +See `mod_wsgi_tester.py `_ From 0735c8edc80400a14e4aabde6b5a43643c8d9f8d Mon Sep 17 00:00:00 2001 From: Steven Silvester Date: Fri, 2 Oct 2026 06:45:56 -0500 Subject: [PATCH 2/3] PYTHON-6104 [v4.18] Address review: document manual mod_wsgi test sequence --- .evergreen/scripts/mod_wsgi_tester.py | 4 +++- test/mod_wsgi_test/README.rst | 18 ++++++++++++------ 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/.evergreen/scripts/mod_wsgi_tester.py b/.evergreen/scripts/mod_wsgi_tester.py index 5968849068..2c33e50b78 100644 --- a/.evergreen/scripts/mod_wsgi_tester.py +++ b/.evergreen/scripts/mod_wsgi_tester.py @@ -90,4 +90,6 @@ def teardown_mod_wsgi() -> None: if __name__ == "__main__": - setup_mod_wsgi() + if len(sys.argv) != 2 or sys.argv[1] not in ("standalone", "embedded"): + raise SystemExit("Usage: python mod_wsgi_tester.py ") + setup_mod_wsgi(sys.argv[1]) diff --git a/test/mod_wsgi_test/README.rst b/test/mod_wsgi_test/README.rst index 615e22d6c0..ba0c7ea033 100644 --- a/test/mod_wsgi_test/README.rst +++ b/test/mod_wsgi_test/README.rst @@ -101,11 +101,17 @@ The script also encodes and decodes all BSON types to ensure that multiple sub interpreters in the same process are supported. This tests the workaround added in `PYTHON-569 `_. -Automation ----------- +Manual testing +-------------- The Evergreen configuration no longer runs these tests automatically. They -can be run by hand with the ``mod_wsgi_tester.py`` helper, which starts up -Apache, starts a single server or replica set, and runs ``test_client.py`` -with the proper arguments. -See `mod_wsgi_tester.py `_ +can only be run from an Evergreen Linux host that has the Python toolchain:: + + just run-server # or: TOPOLOGY=replica_set just run-server + just setup-tests mod_wsgi # mode is "standalone" or "embedded" + just run-tests + +The `mod_wsgi_tester.py `_ +helper performs the Apache setup, test, and teardown steps that the ``just`` +commands dispatch to. It does not start MongoDB; use ``just run-server`` for +that. From 06591a038becf09758d10b6ca2059b15a8f67911 Mon Sep 17 00:00:00 2001 From: Steven Silvester Date: Fri, 2 Oct 2026 06:54:00 -0500 Subject: [PATCH 3/3] PYTHON-6104 [v4.18] Address review: fix mod_wsgi test example and document teardown --- test/mod_wsgi_test/README.rst | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/test/mod_wsgi_test/README.rst b/test/mod_wsgi_test/README.rst index ba0c7ea033..e212cd9265 100644 --- a/test/mod_wsgi_test/README.rst +++ b/test/mod_wsgi_test/README.rst @@ -108,8 +108,12 @@ The Evergreen configuration no longer runs these tests automatically. They can only be run from an Evergreen Linux host that has the Python toolchain:: just run-server # or: TOPOLOGY=replica_set just run-server - just setup-tests mod_wsgi # mode is "standalone" or "embedded" + just setup-tests mod_wsgi standalone # or: just setup-tests mod_wsgi embedded just run-tests + just teardown-tests + +Run ``just teardown-tests`` even if the tests fail: it stops the Apache +instance started by the setup step, which ``just run-tests`` leaves running. The `mod_wsgi_tester.py `_ helper performs the Apache setup, test, and teardown steps that the ``just``