|
|
@ -4,6 +4,12 @@ check_redis_running() {
|
|
|
|
return $?
|
|
|
|
return $?
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Quit early if Redis server isn't running
|
|
|
|
|
|
|
|
if ! check_redis_running; then
|
|
|
|
|
|
|
|
echo "Redis not running." >&2
|
|
|
|
|
|
|
|
exit 2
|
|
|
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
if command -v rg >/dev/null; then
|
|
|
|
if command -v rg >/dev/null; then
|
|
|
|
safe_rg=rg
|
|
|
|
safe_rg=rg
|
|
|
|
else
|
|
|
|
else
|
|
|
@ -12,13 +18,15 @@ else
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
export ONLY_RUN_FAST_TESTS=1
|
|
|
|
export ONLY_RUN_FAST_TESTS=1
|
|
|
|
if [ "$1" == '-f' ]; then # Poor man's argparse
|
|
|
|
if [ "$1" = '-f' ]; then # Poor man's argparse
|
|
|
|
unset ONLY_RUN_FAST_TESTS
|
|
|
|
unset ONLY_RUN_FAST_TESTS
|
|
|
|
|
|
|
|
shift 1
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
if check_redis_running; then
|
|
|
|
# For use on build server, we need exit code to be representative of success/failure
|
|
|
|
/usr/bin/env python -m unittest discover -v -s tests $@ 2>&1 | egrep -v '^test_' | $safe_rg
|
|
|
|
if [ "$1" = '-x' ]; then
|
|
|
|
|
|
|
|
shift 1
|
|
|
|
|
|
|
|
/usr/bin/env python -m unittest discover -v -s tests $@ 2>&1
|
|
|
|
else
|
|
|
|
else
|
|
|
|
echo "Redis not running." >&2
|
|
|
|
/usr/bin/env python -m unittest discover -v -s tests $@ 2>&1 | egrep -v '^test_' | $safe_rg
|
|
|
|
exit 2
|
|
|
|
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|