From 0c4bcca7c9f0a9225e335dc25c3da3f2154277b2 Mon Sep 17 00:00:00 2001 From: Sandro Santilli Date: Thu, 12 Sep 2013 10:17:02 +0200 Subject: [PATCH] Read redis port from test.js environment when running tests --- run_tests.sh | 7 +++---- test/support/prepare_db.sh | 2 +- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/run_tests.sh b/run_tests.sh index 23be79db..a13760ef 100755 --- a/run_tests.sh +++ b/run_tests.sh @@ -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 diff --git a/test/support/prepare_db.sh b/test/support/prepare_db.sh index 567b4d1e..6dbdfae9 100755 --- a/test/support/prepare_db.sh +++ b/test/support/prepare_db.sh @@ -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}"