From a1537e21289ec8616656dc6e575a25f5e2e20649 Mon Sep 17 00:00:00 2001 From: Gyorgy Sarvari Date: Fri, 16 Jan 2026 16:33:09 +0100 Subject: python3-django: add ptest support Execute the standard, non-selenium tests. The execution is on the slower side: on my idle machine, KVM enabled it takes a bit more than 2.5 minutes to execute it (executing tests with 4 threads parallel, 1/core, the default configuration). If the machine is under load, it easily grows to over 10 minutes. Added two backported patches for Django 5.2 to fix some tests that would otherwise fail: 0001-Fix-test_strip_tags-test.patch: tag stripping tests failed due to changed Python behavior 0001-fix-test_msgfmt_error_including_non_ascii-test.patch: tests were updated to work with msgfmt 0.25 Most of the skipped tests require some specific database backend (Postgres, MySQL, Oracle...) or are Selenium tests. When the default parallelism is used for the execution, the package needs 3GB RAM at least. The output is very long (the suite contains way over 15k tests), so I omit the example output here. The current summary (for v5.2.9): Ran 18121 tests in 140.891s OK (skipped=1394, expected failures=5) Signed-off-by: Gyorgy Sarvari Signed-off-by: Khem Raj --- .../recipes-devtools/python/python3-django/run-ptest | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 meta-python/recipes-devtools/python/python3-django/run-ptest (limited to 'meta-python/recipes-devtools/python/python3-django/run-ptest') diff --git a/meta-python/recipes-devtools/python/python3-django/run-ptest b/meta-python/recipes-devtools/python/python3-django/run-ptest new file mode 100644 index 0000000000..dd257cc843 --- /dev/null +++ b/meta-python/recipes-devtools/python/python3-django/run-ptest @@ -0,0 +1,19 @@ +#!/bin/sh +useradd tester || echo test user exists already + +# We need $(pwd), because some tests import modules from the actual tests folder +# Also, there is one module in the docs/_ext folder that is imported, and that +# module accesses other modules by a relative path to itself. +export PYTHONPATH=$(pwd):$(pwd)/docs/_ext:$PYTHONPATH + +cd tests + +su tester -c "./runtests.py --noinput -v 2" 2>&1 | \ + tee ../testoutput.log | \ + sed -e '/\.\.\. ok/ s/^/PASS: /g' \ + -e '/\.\.\. [ERROR|FAIL]/ s/^/FAIL: /g' \ + -e '/\.\.\. skipped/ s/^/SKIP: /g' \ + -e 's/ \.\.\. ok//g' \ + -e 's/ \.\.\. ERROR//g' \ + -e 's/ \.\.\. FAIL//g' \ + -e 's/ \.\.\. skipped//g' -- cgit v1.2.3-54-g00ecf