Merge "tox: split redis/memcached env"

This commit is contained in:
Jenkins 2014-11-04 11:28:21 +00:00 committed by Gerrit Code Review
commit 9429341ece
3 changed files with 57 additions and 16 deletions

View File

@ -13,15 +13,6 @@ function clean_exit(){
trap "clean_exit" EXIT
if ! check_port 6379; then
redis_bin=$(which redis-server || true)
if [ -n "$redis_bin" ]; then
$redis_bin --port 6379 &
else
echo "Redis server not available, testing being skipped..."
fi
fi
if ! check_port 11211; then
memcached_bin=$(which memcached || true)
if [ -n "$memcached_bin" ]; then

26
setup-redis-env.sh Executable file
View File

@ -0,0 +1,26 @@
#!/bin/bash -x -e
. functions.sh
function clean_exit(){
local error_code="$?"
local spawned=$(jobs -p)
if [ -n "$spawned" ]; then
kill $(jobs -p)
fi
return $error_code
}
trap "clean_exit" EXIT
if ! check_port 6379; then
redis_bin=$(which redis-server || true)
if [ -n "$redis_bin" ]; then
$redis_bin --port 6379 &
else
echo "Redis server not available, testing being skipped..."
fi
fi
# Yield execution to venv command
$*

38
tox.ini
View File

@ -1,15 +1,14 @@
[tox]
minversion = 1.6
skipsdist = True
envlist = py26,py27,py33,py34,py27-zookeeper,py33-zookeeper,py34-zookeeper,pep8
envlist = py26,py27,py33,py34,py27-zookeeper,py33-zookeeper,py34-zookeeper,py27-redis,py33-redis,py34-redis,py27-memcached,py33-memcached,py34-memcached,pep8
[testenv]
deps = -r{toxinidir}/requirements.txt
-r{toxinidir}/test-requirements.txt
install_command = pip install -U {opts} {packages}
usedevelop = True
commands =
bash -x {toxinidir}/setup-test-env.sh python setup.py testr --slowest --testr-args="{posargs}"
commands = python setup.py testr --slowest --testr-args="{posargs}"
[testenv:venv]
deps = -r{toxinidir}/requirements.txt
@ -19,8 +18,8 @@ commands = {posargs}
[testenv:py27]
deps = {[testenv]deps}
doc8
commands = bash -x {toxinidir}/setup-test-env.sh python setup.py testr --slowest --testr-args="{posargs}"
bash -x {toxinidir}/setup-test-env.sh {toxinidir}/run-examples.sh
commands = python setup.py testr --slowest --testr-args="{posargs}"
{toxinidir}/run-examples.sh
doc8 doc/source
[testenv:py33]
@ -44,9 +43,34 @@ deps = {[testenv:py34]deps}
basepython = python3.4
commands = {toxinidir}/setup-zookeeper-env.sh python setup.py testr --slowest --testr-args="{posargs}"
[testenv:py27-redis]
commands = {toxinidir}/setup-redis-env.sh python setup.py testr --slowest --testr-args="{posargs}"
[testenv:py33-redis]
deps = {[testenv:py33]deps}
basepython = python3.3
commands = {toxinidir}/setup-redis-env.sh python setup.py testr --slowest --testr-args="{posargs}"
[testenv:py34-redis]
deps = {[testenv:py34]deps}
basepython = python3.4
commands = {toxinidir}/setup-redis-env.sh python setup.py testr --slowest --testr-args="{posargs}"
[testenv:py27-memcached]
commands = {toxinidir}/setup-memcached-env.sh python setup.py testr --slowest --testr-args="{posargs}"
[testenv:py33-memcached]
deps = {[testenv:py33]deps}
basepython = python3.3
commands = {toxinidir}/setup-memcached-env.sh python setup.py testr --slowest --testr-args="{posargs}"
[testenv:py34-memcached]
deps = {[testenv:py34]deps}
basepython = python3.4
commands = {toxinidir}/setup-memcached-env.sh python setup.py testr --slowest --testr-args="{posargs}"
[testenv:cover]
commands =
bash -x {toxinidir}/setup-test-env.sh python setup.py testr --slowest --coverage --testr-args="{posargs}"
commands = python setup.py testr --slowest --coverage --testr-args="{posargs}"
[testenv:docs]
deps = {[testenv]deps}