summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichał Górny <mgorny@gentoo.org>2023-08-07 04:44:44 +0200
committerMichał Górny <mgorny@gentoo.org>2023-08-07 05:01:14 +0200
commit16fd5a7788d7f3fcd8dae6710bba6b4072c4b0ee (patch)
tree572a9ce83e5d2a10c9e1b474ec3bed7918492ecf /dev-python/aiocache/aiocache-0.12.2.ebuild
parentdev-python/pypdf: Bump to 3.15.0 (diff)
downloadgentoo-16fd5a7788d7f3fcd8dae6710bba6b4072c4b0ee.tar.gz
gentoo-16fd5a7788d7f3fcd8dae6710bba6b4072c4b0ee.tar.bz2
gentoo-16fd5a7788d7f3fcd8dae6710bba6b4072c4b0ee.zip
dev-python/aiocache: Enable acceptance tests
Signed-off-by: Michał Górny <mgorny@gentoo.org>
Diffstat (limited to 'dev-python/aiocache/aiocache-0.12.2.ebuild')
-rw-r--r--dev-python/aiocache/aiocache-0.12.2.ebuild25
1 files changed, 22 insertions, 3 deletions
diff --git a/dev-python/aiocache/aiocache-0.12.2.ebuild b/dev-python/aiocache/aiocache-0.12.2.ebuild
index bba70b471f05..654d767ca7eb 100644
--- a/dev-python/aiocache/aiocache-0.12.2.ebuild
+++ b/dev-python/aiocache/aiocache-0.12.2.ebuild
@@ -20,6 +20,7 @@ KEYWORDS="~amd64 ~x86"
BDEPEND="
test? (
+ dev-db/redis
>=dev-python/msgpack-0.5.5[${PYTHON_USEDEP}]
dev-python/pytest-asyncio[${PYTHON_USEDEP}]
>=dev-python/redis-4.2.0[${PYTHON_USEDEP}]
@@ -30,9 +31,6 @@ distutils_enable_tests pytest
python_test() {
local EPYTEST_IGNORE=(
- # require running servers
- # TODO: start redis and enable them
- tests/acceptance
# benchmarks
tests/performance
# requires aiomcache
@@ -41,3 +39,24 @@ python_test() {
epytest -o addopts= -m "not memcached"
}
+
+src_test() {
+ local redis_pid="${T}"/redis.pid
+ local redis_port=6379
+
+ # Spawn Redis for testing purposes
+ einfo "Spawning Redis"
+ einfo "NOTE: Port ${redis_port} must be free"
+ "${EPREFIX}"/usr/sbin/redis-server - <<- EOF || die "Unable to start redis server"
+ daemonize yes
+ pidfile ${redis_pid}
+ port ${redis_port}
+ bind 127.0.0.1 ::1
+ EOF
+
+ # Run the tests
+ distutils-r1_src_test
+
+ # Clean up afterwards
+ kill "$(<"${redis_pid}")" || die
+}