Commit 55d2ac28 authored by Daniel Gerhardt's avatar Daniel Gerhardt Committed by Daniel Gerhardt

Use additional env vars for test setup

parent 55946817
......@@ -20,10 +20,13 @@ chimp:
variables:
PORT: "3000"
ROOT_URL: "http://localhost:$PORT"
MONGO_URL: "mongodb://mongo/meteor-test"
MONGO_HOST: mongo
MONGO_PORT: "27017"
MONGO_DB: meteor-test
MONGO_URL: "mongodb://$MONGO_HOST:$MONGO_PORT/$MONGO_DB"
script:
- export METEOR_SETTINGS="$(cat settings_test.json)"
- mongo --quiet --eval "version();" --host mongo
- mongo --quiet --eval "version();" --host "$MONGO_HOST"
- cd "$BUNDLE_DIR/programs/server" && npm install
- cd -
- node "$BUNDLE_DIR/main.js" &
......
......@@ -4,6 +4,16 @@
searchDir="tests/features/*"
dumpDir="tests/dump/meteor"
if [ -z "$POST" ]; then
PORT=3000
fi
if [ -z "$MONGO_HOST" ]; then
MONGO_HOST=localhost
MONGO_PORT=3001
MONGO_DB=meteor
elif [ -z "$MONGO_PORT" ]; then
MONGO_PORT=27017
fi
#colors
RED='\033[0;31m'
......@@ -39,7 +49,7 @@ for testDir in $searchDir; do
# Drop and Restore the database
echo -e $GREEN"Dropping and Restoring database ..." $NC
if ! mongorestore --drop -h 127.0.0.1 --port 3001 -d meteor $dumpDir 1> /dev/null; then
if ! mongorestore --drop -h "$MONGO_HOST" --port "$MONGO_PORT" -d "$MONGO_DB" $dumpDir 1> /dev/null; then
echo -e $RED"mongorestore failed!" $NC
exit 2
fi
......@@ -49,7 +59,7 @@ for testDir in $searchDir; do
if [ $DISPLAY -n ] ; then
xvfb-run --server-args="-screen 0 1920x1080x16" chimp --ddp=http://localhost:3000 --path=$testDir --browser=firefox $1
else
chimp --ddp=http://localhost:3000 --path=$testDir --browser=firefox $1
chimp --ddp=http://localhost:$PORT --path=$testDir --browser=firefox $1
fi
if [ $? -ne 0 ]; then
failedTests=$((failedTests+1))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment