Run the suite in a pinned container with ci.sh

This commit is contained in:
2026-11-09 02:41:29 +01:00
parent 455efdc0d1
commit 547a9505fd
3 changed files with 33 additions and 0 deletions
Executable
+12
View File
@@ -0,0 +1,12 @@
#!/bin/sh
# Runs the test suite on the committed HEAD as CI does: in a pinned Python container, as the caller's uid, so the tests root skips run too.
# The repo goes in as a git bundle rather than a bind mount, so the script works whether the CI runner shares the docker daemon's filesystem or not.
set -eu
cd "$(dirname "$0")"
git bundle create - HEAD | docker run --rm -i --memory 4g --memory-swap 4g --user "$(id -u):$(id -g)" -e HOME=/tmp python:3.14.8 sh -euc '
cat >/tmp/head.bundle
git clone --quiet /tmp/head.bundle /tmp/repo
cd /tmp/repo
python3 -m pip install --quiet --user uv==0.12.23
PATH="$HOME/.local/bin:$PATH" uvx --python "$(command -v python3)" --with pytest-xdist==3.8.0 pytest==9.2.0 -n 4 bin
'