Skip to content
Snippets Groups Projects
Commit f5e46474 authored by Antoine Martin's avatar Antoine Martin Committed by omni
Browse files

community/py3-django-q2: enable tests

parent ae78f5bd
No related branches found
No related tags found
1 merge request!65404community/py3-django-q2: enable tests
Pipeline #232392 skipped
......@@ -3,7 +3,7 @@
pkgname=py3-django-q2
_pyname="django-q2"
pkgver=1.6.2
pkgrel=1
pkgrel=2
arch="noarch"
pkgdesc="A multiprocessing distributed task queue for Django"
url="https://pypi.python.org/project/django-q2"
......@@ -28,13 +28,15 @@ makedepends="
py3-poetry-core
"
checkdepends="
py3-pytest
valkey
py3-pytest-django
py3-boto3
py3-psutil
py3-mongo
"
# 'python-boto3: Amazon Simple Queue Service message queue support'
# 'python-psutil: resource usage limit support'
# 'python-pymongo: MongoDB as a message broker support'
options="!check" # Missing check depends
source="$pkgname-$pkgver.tar.gz::https://github.com/django-q2/django-q2/archive/refs/tags/v$pkgver.tar.gz
source="
$pkgname-$pkgver.tar.gz::https://github.com/django-q2/django-q2/archive/refs/tags/v$pkgver.tar.gz
fix-HiredisParser-reference.patch
"
builddir="$srcdir"/$_pyname-$pkgver
subpackages="$pkgname-pyc"
......@@ -46,7 +48,20 @@ build() {
}
check() {
PYTHONPATH="$builddir" pytest -v
valkey-server &
python3 -m venv --clear --without-pip --system-site-packages .testenv
.testenv/bin/python3 -m installer .dist/*.whl
# test_qcluster: stalls
# test_scheduler: requires croniter module
# test_mongo: reqires setting up mongo server
# test_max_rss: failure on 32-bit arches
REDIS_HOST=127.0.0.1 \
MONGO_HOST=127.0.0.1 \
.testenv/bin/python3 -m pytest -v -k 'not test_qcluster and not test_scheduler and not test_mongo and not test_max_rss' || FAIL=true
pkill valkey-server
if [ "$FAIL" = "true" ]; then
return 1
fi
}
package() {
......@@ -56,4 +71,5 @@ package() {
sha512sums="
1d33a29f392bae84e44f637ebfeadb9fad7623732aa7f1e46ee2712459b1fefc501ad240415803542d9ded1835aaa372f5c3f5ad1ba285d4b1d158f3921aa7e4 py3-django-q2-1.6.2.tar.gz
b4df8b946cff0b9160a8dc2a94f7ebbc288c35a4ee956f3f29d7a268f6a769bbc2bfdec6b7bd2e4c7134974820f306d07dfba37aeae2c37b8b9eefb2b3f3e5d4 fix-HiredisParser-reference.patch
"
diff --git a/django_q/tests/settings.py.orig b/django_q/tests/settings.py
index b6246449429..b8b2f780e8e 100644
--- a/django_q/tests/settings.py.orig
+++ b/django_q/tests/settings.py
@@ -116,7 +116,7 @@ CACHES = {
"LOCATION": f"redis://{REDIS_HOST}:6379/0",
"OPTIONS": {
"CLIENT_CLASS": "django_redis.client.DefaultClient",
- "PARSER_CLASS": "redis.connection.HiredisParser",
+ "PARSER_CLASS": "redis.connection._HiredisParser",
},
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment