Read redis port from test.js environment when running tests

This commit is contained in:
Sandro Santilli 2013-09-12 10:17:02 +02:00
parent 0414307679
commit 0c4bcca7c9
2 changed files with 4 additions and 5 deletions

View File

@ -1,9 +1,5 @@
#!/bin/sh
# Must match redis_port in config/environments/test.js
# TODO: read from there
REDIS_PORT=6333
OPT_CREATE=yes # create the test environment
OPT_DROP=yes # drop the test environment
@ -11,6 +7,9 @@ cd $(dirname $0)
BASEDIR=$(pwd)
cd -
REDIS_PORT=`node -e "console.log(require('${BASEDIR}/config/environments/test.js').redis.port)"`
export REDIS_PORT
cleanup() {
if test x"$OPT_DROP" = xyes; then
if test x"$PID_REDIS" = x; then

View File

@ -17,7 +17,7 @@ die() {
}
TEST_DB="cartodb_test_user_1_db"
REDIS_PORT=6333
if test -z "$REDIS_PORT"; then REDIS_PORT=6333; fi
echo "preparing postgres..."
dropdb "${TEST_DB}"