Option to skip sql files download

This commit is contained in:
Raul Ochoa 2016-05-31 16:57:28 +02:00
parent 6644711969
commit 22f3a54fbf
2 changed files with 16 additions and 1 deletions

View File

@ -5,6 +5,7 @@ OPT_CREATE_PGSQL=yes # create the PostgreSQL test environment
OPT_DROP_REDIS=yes # drop the redis test environment 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
export PGAPPNAME=cartodb_tiler_tester export PGAPPNAME=cartodb_tiler_tester
@ -73,6 +74,10 @@ while [ -n "$1" ]; do
OPT_CREATE_REDIS=no OPT_CREATE_REDIS=no
shift shift
continue continue
elif test "$1" = "--no-sql-download"; then
OPT_DOWNLOAD_SQL=no
shift
continue
elif test "$1" = "--with-coverage"; then elif test "$1" = "--with-coverage"; then
OPT_COVERAGE=yes OPT_COVERAGE=yes
shift shift
@ -113,6 +118,9 @@ fi
if test x"$OPT_CREATE_REDIS" != xyes; then if test x"$OPT_CREATE_REDIS" != xyes; then
PREPARE_DB_OPTS="$PREPARE_DB_OPTS --skip-redis" PREPARE_DB_OPTS="$PREPARE_DB_OPTS --skip-redis"
fi fi
if test x"$OPT_DOWNLOAD_SQL" != xyes; then
PREPARE_DB_OPTS="$PREPARE_DB_OPTS --no-sql-download"
fi
echo "Preparing the environment" echo "Preparing the environment"
cd ${BASEDIR}/test/support cd ${BASEDIR}/test/support

View File

@ -12,6 +12,7 @@
PREPARE_REDIS=yes PREPARE_REDIS=yes
PREPARE_PGSQL=yes PREPARE_PGSQL=yes
DOWNLOAD_SQL_FILES=yes
while [ -n "$1" ]; do while [ -n "$1" ]; do
if test "$1" = "--skip-pg"; then if test "$1" = "--skip-pg"; then
@ -20,6 +21,9 @@ while [ -n "$1" ]; do
elif test "$1" = "--skip-redis"; then elif test "$1" = "--skip-redis"; then
PREPARE_REDIS=no PREPARE_REDIS=no
shift; continue shift; continue
elif test "$1" = "--no-sql-download"; then
DOWNLOAD_SQL_FILES=no
shift; continue
fi fi
done done
@ -79,7 +83,10 @@ if test x"$PREPARE_PGSQL" = xyes; then
do do
CURL_ARGS="${CURL_ARGS}\"https://github.com/CartoDB/cartodb-postgresql/raw/master/scripts-available/$i.sql\" -o sql/$i.sql " CURL_ARGS="${CURL_ARGS}\"https://github.com/CartoDB/cartodb-postgresql/raw/master/scripts-available/$i.sql\" -o sql/$i.sql "
done done
echo ${CURL_ARGS} | xargs curl -L -s if test x"$DOWNLOAD_SQL_FILES" = xyes; then
echo "Downloading and updating: ${REMOTE_SQL_SCRIPTS}"
echo ${CURL_ARGS} | xargs curl -L -s
fi
ALL_SQL_SCRIPTS="${REMOTE_SQL_SCRIPTS} ${LOCAL_SQL_SCRIPTS}" ALL_SQL_SCRIPTS="${REMOTE_SQL_SCRIPTS} ${LOCAL_SQL_SCRIPTS}"
for i in ${ALL_SQL_SCRIPTS} for i in ${ALL_SQL_SCRIPTS}