From fc6eac9b068e59fdf36f3ef233f97e7170bf1814 Mon Sep 17 00:00:00 2001 From: Steven Silvester Date: Fri, 14 Jun 2024 11:29:44 -0500 Subject: [PATCH 1/2] PYTHON-4504 Update mod_wsgi test to not call setup.py (#1684) (cherry picked from commit fe0faf74a6a408b492e0e7f77de2f985c5d68f63) --- .evergreen/run-mod-wsgi-tests.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.evergreen/run-mod-wsgi-tests.sh b/.evergreen/run-mod-wsgi-tests.sh index afb3f271ae..d572ec4ca4 100644 --- a/.evergreen/run-mod-wsgi-tests.sh +++ b/.evergreen/run-mod-wsgi-tests.sh @@ -19,7 +19,7 @@ fi PYTHON_VERSION=$(${PYTHON_BINARY} -c "import sys; sys.stdout.write('.'.join(str(val) for val in sys.version_info[:2]))") # Ensure the C extensions are installed. -${PYTHON_BINARY} setup.py build_ext -i +${PYTHON_BINARY} -m pip install -e . export MOD_WSGI_SO=/opt/python/mod_wsgi/python_version/$PYTHON_VERSION/mod_wsgi_version/$MOD_WSGI_VERSION/mod_wsgi.so export PYTHONHOME=/opt/python/$PYTHON_VERSION From 27815f8106e1f96856d8027d0a88cea5b9b07657 Mon Sep 17 00:00:00 2001 From: Steven Silvester Date: Fri, 14 Jun 2024 18:58:14 -0500 Subject: [PATCH 2/2] PYTHON-4504 Use a venv for mod_wsgi test (#1687) (cherry picked from commit bba5f8153a2f434f4454d57f4beb63d1ea7143c3) --- .evergreen/run-import-time-test.sh | 2 ++ .evergreen/run-mod-wsgi-tests.sh | 11 ++++++++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/.evergreen/run-import-time-test.sh b/.evergreen/run-import-time-test.sh index f013eb115c..2b17f5ffeb 100755 --- a/.evergreen/run-import-time-test.sh +++ b/.evergreen/run-import-time-test.sh @@ -25,7 +25,9 @@ function get_import_time() { } get_import_time $HEAD_SHA +git stash git checkout $BASE_SHA get_import_time $BASE_SHA git checkout $HEAD_SHA +git stash apply python tools/compare_import_time.py $HEAD_SHA $BASE_SHA diff --git a/.evergreen/run-mod-wsgi-tests.sh b/.evergreen/run-mod-wsgi-tests.sh index d572ec4ca4..e1f5238110 100644 --- a/.evergreen/run-mod-wsgi-tests.sh +++ b/.evergreen/run-mod-wsgi-tests.sh @@ -19,7 +19,10 @@ fi PYTHON_VERSION=$(${PYTHON_BINARY} -c "import sys; sys.stdout.write('.'.join(str(val) for val in sys.version_info[:2]))") # Ensure the C extensions are installed. -${PYTHON_BINARY} -m pip install -e . +${PYTHON_BINARY} -m venv --system-site-packages .venv +source .venv/bin/activate +pip install -U pip +python -m pip install -e . export MOD_WSGI_SO=/opt/python/mod_wsgi/python_version/$PYTHON_VERSION/mod_wsgi_version/$MOD_WSGI_VERSION/mod_wsgi.so export PYTHONHOME=/opt/python/$PYTHON_VERSION @@ -38,10 +41,12 @@ trap '$APACHE -k stop -f ${PROJECT_DIRECTORY}/test/mod_wsgi_test/${APACHE_CONFIG wget -t 1 -T 10 -O - "http://localhost:8080/interpreter1${PROJECT_DIRECTORY}" || (cat error_log && exit 1) wget -t 1 -T 10 -O - "http://localhost:8080/interpreter2${PROJECT_DIRECTORY}" || (cat error_log && exit 1) -${PYTHON_BINARY} ${PROJECT_DIRECTORY}/test/mod_wsgi_test/test_client.py -n 25000 -t 100 parallel \ +python ${PROJECT_DIRECTORY}/test/mod_wsgi_test/test_client.py -n 25000 -t 100 parallel \ http://localhost:8080/interpreter1${PROJECT_DIRECTORY} http://localhost:8080/interpreter2${PROJECT_DIRECTORY} || \ (tail -n 100 error_log && exit 1) -${PYTHON_BINARY} ${PROJECT_DIRECTORY}/test/mod_wsgi_test/test_client.py -n 25000 serial \ +python ${PROJECT_DIRECTORY}/test/mod_wsgi_test/test_client.py -n 25000 serial \ http://localhost:8080/interpreter1${PROJECT_DIRECTORY} http://localhost:8080/interpreter2${PROJECT_DIRECTORY} || \ (tail -n 100 error_log && exit 1) + +rm -rf .venv