-
Notifications
You must be signed in to change notification settings - Fork 39
/
runTests
executable file
·23 lines (15 loc) · 727 Bytes
/
runTests
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/bin/bash
set -eu
# create the same mongo server version as cloudron has
CONTAINER_NAME="mongo-server-meemo-test"
docker rm --force ${CONTAINER_NAME} || true
echo "Starting ${CONTAINER_NAME}..."
docker run --name ${CONTAINER_NAME} -d mongo:3.6-xenial
export MONGODB_IP=`docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' ${CONTAINER_NAME}`
echo "Waiting for mysql server to be ready..."
while ! docker exec -it ${CONTAINER_NAME} mongo --eval "print(\"waited for connection\")"; do
sleep 1
done
export CLOUDRON_MONGODB_URL="mongodb://${MONGODB_IP}:27017/meemo"
echo "export CLOUDRON_MONGODB_URL=\"mongodb://${MONGODB_IP}:27017/meemo\""
./node_modules/.bin/mocha --exit src/test/*-test.js