download redis-cell lib during tests
This commit is contained in:
parent
60bf81d950
commit
54f113ab5f
1
.gitignore
vendored
1
.gitignore
vendored
@ -11,3 +11,4 @@ redis.pid
|
|||||||
*.log
|
*.log
|
||||||
coverage/
|
coverage/
|
||||||
.DS_Store
|
.DS_Store
|
||||||
|
libredis_cell.so
|
||||||
|
17
run_tests.sh
17
run_tests.sh
@ -6,6 +6,7 @@ OPT_DROP_REDIS=yes # drop the redis test environment
|
|||||||
OPT_DROP_PGSQL=yes # drop the PostgreSQL test environment
|
OPT_DROP_PGSQL=yes # drop the PostgreSQL test environment
|
||||||
OPT_COVERAGE=no # run tests with coverage
|
OPT_COVERAGE=no # run tests with coverage
|
||||||
OPT_DOWNLOAD_SQL=yes # download a fresh copy of sql files
|
OPT_DOWNLOAD_SQL=yes # download a fresh copy of sql files
|
||||||
|
OPT_REDIS_CELL=yes # download redis cell
|
||||||
|
|
||||||
export PGAPPNAME=cartodb_tiler_tester
|
export PGAPPNAME=cartodb_tiler_tester
|
||||||
|
|
||||||
@ -49,6 +50,16 @@ die() {
|
|||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
get_redis_cell() {
|
||||||
|
if test x"$OPT_REDIS_CELL" = xyes; then
|
||||||
|
echo "Downloading redis-cell"
|
||||||
|
wget https://github.com/brandur/redis-cell/releases/download/v0.2.2/redis-cell-v0.2.2-x86_64-unknown-linux-gnu.tar.gz > /dev/null 2>&1
|
||||||
|
tar xvzf redis-cell-v0.2.2-x86_64-unknown-linux-gnu.tar.gz > /dev/null 2>&1
|
||||||
|
rm redis-cell-v0.2.2-x86_64-unknown-linux-gnu.tar.gz
|
||||||
|
rm libredis_cell.d
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
trap 'cleanup_and_exit' 1 2 3 5 9 13
|
trap 'cleanup_and_exit' 1 2 3 5 9 13
|
||||||
|
|
||||||
while [ -n "$1" ]; do
|
while [ -n "$1" ]; do
|
||||||
@ -88,6 +99,10 @@ while [ -n "$1" ]; do
|
|||||||
OPT_CREATE_PGSQL=no
|
OPT_CREATE_PGSQL=no
|
||||||
shift
|
shift
|
||||||
continue
|
continue
|
||||||
|
elif test "$1" = "--norediscell"; then
|
||||||
|
OPT_REDIS_CELL=no
|
||||||
|
shift
|
||||||
|
continue
|
||||||
else
|
else
|
||||||
break
|
break
|
||||||
fi
|
fi
|
||||||
@ -99,12 +114,14 @@ if [ -z "$1" ]; then
|
|||||||
echo " --nocreate do not create the test environment on start" >&2
|
echo " --nocreate do not create the test environment on start" >&2
|
||||||
echo " --nodrop do not drop the test environment on exit" >&2
|
echo " --nodrop do not drop the test environment on exit" >&2
|
||||||
echo " --with-coverage use istanbul to determine code coverage" >&2
|
echo " --with-coverage use istanbul to determine code coverage" >&2
|
||||||
|
echo " --norediscell do not download redis-cell" >&2
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
TESTS=$@
|
TESTS=$@
|
||||||
|
|
||||||
if test x"$OPT_CREATE_REDIS" = xyes; then
|
if test x"$OPT_CREATE_REDIS" = xyes; then
|
||||||
|
get_redis_cell
|
||||||
echo "Starting redis on port ${REDIS_PORT}"
|
echo "Starting redis on port ${REDIS_PORT}"
|
||||||
echo "port ${REDIS_PORT}" | redis-server - --loadmodule ./libredis_cell.so > ${BASEDIR}/test.log &
|
echo "port ${REDIS_PORT}" | redis-server - --loadmodule ./libredis_cell.so > ${BASEDIR}/test.log &
|
||||||
PID_REDIS=$!
|
PID_REDIS=$!
|
||||||
|
Loading…
Reference in New Issue
Block a user