From a5f2ff331ba650afee5a183c15ed3707c92a51a9 Mon Sep 17 00:00:00 2001 From: Gabriel Harris-Rouquette Date: Sat, 10 Oct 2026 22:01:08 -0700 Subject: [PATCH] chore(dev): add mise test:docker task Run the suite in python:3.12 against the local Postgres, matching CI's Linux image output. test_avatar_upload_path only passes on Linux, because Pillow's PNG compression differs on macOS. Signed-off-by: Gabriel Harris-Rouquette --- mise.toml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/mise.toml b/mise.toml index b67f7995..28542cf5 100644 --- a/mise.toml +++ b/mise.toml @@ -47,6 +47,17 @@ dir = "spongeauth" env = { PYTHONPATH = ".", DJANGO_SETTINGS_SKIP_LOCAL = "True", LANG = "C" } run = "pytest --cov-config=../.coveragerc --cov=. {{arg(name='pytest_args', var=true, default='')}}" +[tasks."test:docker"] +description = "Run the test suite in Linux like CI, e.g. when macOS image output differs (needs `mise run db`)" +run = """ +docker run --rm -t \ + -v "$PWD:/src" -v spongeauth-pip-cache:/root/.cache/pip -w /src/spongeauth \ + -e DB_HOST=host.docker.internal -e DB_USER -e DB_PASSWORD \ + -e PYTHONPATH=. -e PYTHONDONTWRITEBYTECODE=1 -e DJANGO_SETTINGS_SKIP_LOCAL=True -e LANG=C \ + python:3.12 sh -c \ + 'pip install -q --root-user-action=ignore --disable-pip-version-check --src /tmp/src -r ../requirements/test.txt && pytest -p no:cacheprovider "$@"' -- +""" + [tasks.lint] description = "Run prospector" run = ["prospector --die-on-tool-error", "actionlint"]