Some small modifications to test script

that let me run tests against dev environment.
This commit is contained in:
Rafa de la Torre
2015-10-21 16:32:58 +02:00
parent 8f5824f5b0
commit f6fdb762bc

View File

@@ -10,14 +10,16 @@ source functions/test.sh
# SQL_API_ROUTE and API_KEY need to be
# conveniently filled for the requests
# to work.
# Example: bash run.sh api sql_api_route api_key test_type
# Syntax: bash run.sh api sql_api_route api_key test_type
# E.g: bash run.sh api http://development.localhost.lan:8080/api/v1 916f4c31aaa35d6b867dae9a7f54270d functions
#
# SQL
# ====================================
# It is expected that you run this script
# as a PostgreSQL superuser, for example:
#
# bash run.sh db database role test_type
# Syntax: bash run.sh db database role test_type
# E.g: bash run.sh db cartodb_dev_user_fe3b850a-01c0-48f9-8a26-a82f09e9b53f_db postgres data
#
# test_type defines the kind of tests to run: data or functions
@@ -52,7 +54,7 @@ function sql() {
then
# SQL API mode
echo $QUERY
RESULT=$(curl -s -X POST "https://$SQL_API_ROUTE/sql?api_key=$API_KEY&format=csv" --data-urlencode "q=$QUERY" |tail -n1 | tr -d '\r')
RESULT=$(curl -s -X POST "$SQL_API_ROUTE/sql?api_key=$API_KEY&format=csv" --data-urlencode "q=$QUERY" |tail -n1 | tr -d '\r')
if [[ "$2" == "should" ]]
then
if [[ "${RESULT}" != "$3" ]]