From 16fd5a7788d7f3fcd8dae6710bba6b4072c4b0ee Mon Sep 17 00:00:00 2001 From: Michał Górny Date: Mon, 7 Aug 2023 04:44:44 +0200 Subject: dev-python/aiocache: Enable acceptance tests MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Michał Górny --- dev-python/aiocache/aiocache-0.12.2.ebuild | 25 ++++++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) (limited to 'dev-python/aiocache/aiocache-0.12.2.ebuild') 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 +} -- cgit v1.2.3-65-gdbad