Change way env vars for tests are set

This commit is contained in:
James
2017-06-14 12:16:30 -07:00
parent b45ad6d5f9
commit 1523144ff9
2 changed files with 10 additions and 8 deletions

16
test.sh
View File

@@ -9,17 +9,18 @@ docker run --name func-mysql-test -p 3307:3306 -e MYSQL_DATABASE=funcs -e MYSQL_
docker rm -fv func-redis-test|| echo No prev redis test db container
docker run --name func-redis-test -p 6301:6379 -d redis
sleep 5
if [ `uname` == "Darwin" ]
then
export POSTGRES_HOST=localhost
case ${DOCKER_LOCATION-localhost} in
docker_ip)
export POSTGRES_HOST=${DOCKER_HOST-localhost}
export POSTGRES_PORT=15432
export MYSQL_HOST=localhost
export MYSQL_HOST=${DOCKER_HOST-localhost}
export MYSQL_PORT=3307
export REDIS_HOST=localhost
export REDIS_HOST=${DOCKER_HOST-localhost}
export REDIS_PORT=6301
else
;;
container_ip)
export POSTGRES_HOST="$(docker inspect -f '{{.NetworkSettings.IPAddress}}' func-postgres-test)"
export POSTGRES_PORT=5432
@@ -28,7 +29,8 @@ else
export REDIS_HOST="$(docker inspect -f '{{.NetworkSettings.IPAddress}}' func-redis-test)"
export REDIS_PORT=6379
fi
;;
esac
go test -v $(go list ./... | grep -v vendor | grep -v examples | grep -v tool | grep -v fn)
# go test -v gitlab-odx.oracle.com/odx/functions/api/runner/drivers/docker