]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
test: move runtests-pyhttpd.sh into pyhttpd/ as runtests.sh
authorJim Jagielski <jim@apache.org>
Thu, 4 Jun 2026 02:15:25 +0000 (02:15 +0000)
committerJim Jagielski <jim@apache.org>
Thu, 4 Jun 2026 02:15:25 +0000 (02:15 +0000)
  Move runtests-pyhttpd.sh from test/ to test/pyhttpd/runtests.sh
  to match the pytest_suite/runtests.sh naming convention.

  - Update internal paths: $here/pyhttpd/... -> $here/... since $here
    now resolves to test/pyhttpd/ itself.
  - Update run-all-tests.sh to call ./pyhttpd/runtests.sh.
  - Update README.pytest and .claude/settings.local.json references.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1934955 13f79535-47bb-0310-9956-ffa450edef68

test/README.pytest
test/pyhttpd/runtests.sh [new file with mode: 0755]
test/run-all-tests.sh
test/runtests-pyhttpd.sh [deleted file]

index 474030bdc883045f091b0c473b3d6e084dd495c3..620f69c8643c5f361a7f2b4f01f8665afc40be9a 100644 (file)
@@ -127,9 +127,9 @@ processes (an ACME test server).
 
 Infrastructure
 --------------
-The test cases rely on the classes provided in 'test/pyhttpd'
-for common code in managing a httpd test instance and do
-provide some base setups:
+The test cases rely on the classes provided in `test/pyhttpd/` (where
+`test/pyhttpd/runtests.sh` runs the suite) for common code in managing
+a httpd test instance and do provide some base setups:
 - a small set of virtual hosts with some files
 - access to paths and definitions (env fixture)
 - start/stop httpd and inspect the error log
diff --git a/test/pyhttpd/runtests.sh b/test/pyhttpd/runtests.sh
new file mode 100755 (executable)
index 0000000..283b471
--- /dev/null
@@ -0,0 +1,47 @@
+#!/bin/sh
+#
+# runtests.sh -- run the pyhttpd modules/ test suite.
+#
+# Manages a local .venv under pyhttpd/ so that pytest and the CGI helper scripts
+# (which httpd forks) both use the same Python with all required packages
+# (cryptography, python-multipart, websockets, etc.) available.
+#
+# Usage:
+#    ./runtests.sh                    # run all modules/ tests
+#    ./runtests.sh modules/http1      # run a specific suite
+#    ./runtests.sh -k post -v         # any pytest args pass through
+#
+# Environment:
+#   PYHTTPD_TARGETS  space-separated list of test paths (default: modules)
+#
+set -eu
+
+here="$(cd "$(dirname "$0")" && pwd)"
+
+PYTEST="$here/.venv/bin/pytest"
+if [ ! -x "$PYTEST" ]; then
+    if command -v uv >/dev/null 2>&1; then
+        echo "runtests.sh: .venv not found; running 'uv sync' to create it..." >&2
+        uv sync --project "$here"
+    elif command -v python3 >/dev/null 2>&1; then
+        echo "runtests.sh: .venv not found; creating with python3 + pip..." >&2
+        python3 -m venv "$here/.venv"
+         # Keep this list in sync with pyproject.toml [project].dependencies
+         "$here/.venv/bin/pip" install --quiet \
+             "pytest>=7.0" cryptography filelock "python-multipart" pyopenssl packaging websockets
+    else
+        echo "runtests.sh: ERROR: $PYTEST not found and neither 'uv' nor 'python3' is on PATH." >&2
+        exit 1
+    fi
+fi
+
+# Prepend the venv's bin dir so that CGI scripts forked by httpd also resolve
+# python3 to the venv's interpreter (which has all packages installed), and so
+# that any shim wrappers earlier on PATH are shadowed.
+export PATH="$here/.venv/bin:$PATH"
+
+targets="${PYHTTPD_TARGETS:-modules}"
+
+# shellcheck disable=SC2086
+echo "runtests.sh: $PYTEST $targets $*" >&2
+exec "$PYTEST" $targets "$@"
index acc0f3e4906f600d101a142d9cce2a080e2b0da7..c34600620f98b420468ec11fb45483e29b99adf5 100755 (executable)
@@ -136,11 +136,11 @@ run_pyhttpd() {
         echo "  build httpd with its test config (configure) to run these." >&2
         return 0
     fi
-    # runtests-pyhttpd.sh manages the venv, prepends its bin/ to PATH (so CGI
+    # runtests.sh manages the venv, prepends its bin/ to PATH (so CGI
     # scripts forked by httpd also use the venv's Python), and runs pytest.
     # PYHTTPD_TARGETS can override which modules/ subdirs are run.
     # shellcheck disable=SC2086
-    ( cd "$here" && ./runtests-pyhttpd.sh $flags ) || return $?
+    ( cd "$here/pyhttpd" && ./runtests.sh $flags ) || return $?
 }
 
 case "$only" in
diff --git a/test/runtests-pyhttpd.sh b/test/runtests-pyhttpd.sh
deleted file mode 100755 (executable)
index 74cbbdc..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-#!/bin/sh
-#
-# runtests-pyhttpd.sh -- run the pyhttpd modules/ test suite.
-#
-# Manages a local .venv under test/pyhttpd/ so that pytest and the CGI helper scripts
-# (which httpd forks) both use the same Python with all required packages
-# (cryptography, python-multipart, websockets, etc.) available.
-#
-# Usage:
-#   ./runtests-pyhttpd.sh                   # run all modules/ tests
-#   ./runtests-pyhttpd.sh modules/http1     # run a specific suite
-#   ./runtests-pyhttpd.sh -k post -v        # any pytest args pass through
-#
-# Environment:
-#   PYHTTPD_TARGETS  space-separated list of test paths (default: modules)
-#
-set -eu
-
-here="$(cd "$(dirname "$0")" && pwd)"
-cd "$here"
-
-PYTEST="$here/pyhttpd/.venv/bin/pytest"
-if [ ! -x "$PYTEST" ]; then
-    if command -v uv >/dev/null 2>&1; then
-        echo "runtests-pyhttpd.sh: .venv not found; running 'uv sync' to create it..." >&2
-        uv sync --project "$here/pyhttpd"
-    elif command -v python3 >/dev/null 2>&1; then
-        echo "runtests-pyhttpd.sh: .venv not found; creating with python3 + pip..." >&2
-        python3 -m venv "$here/pyhttpd/.venv"
-        # Keep this list in sync with pyhttpd/pyproject.toml [project].dependencies
-        "$here/pyhttpd/.venv/bin/pip" install --quiet \
-            "pytest>=7.0" cryptography filelock "python-multipart" pyopenssl packaging websockets
-    else
-        echo "runtests-pyhttpd.sh: ERROR: $PYTEST not found and neither 'uv' nor 'python3' is on PATH." >&2
-        exit 1
-    fi
-fi
-
-# Prepend the venv's bin dir so that CGI scripts forked by httpd also resolve
-# python3 to the venv's interpreter (which has all packages installed), and so
-# that any shim wrappers earlier on PATH are shadowed.
-export PATH="$here/pyhttpd/.venv/bin:$PATH"
-
-targets="${PYHTTPD_TARGETS:-modules}"
-
-# shellcheck disable=SC2086
-echo "runtests-pyhttpd.sh: $PYTEST $targets $*" >&2
-exec "$PYTEST" $targets "$@"