Improve code that waits to the tests containers to be available.

Signed-off-by: Roberto Rosario <roberto.rosario.gonzalez@gmail.com>
This commit is contained in:
Roberto Rosario
2017-07-22 00:14:51 -04:00
parent 0e39620047
commit 49444faed2

View File

@@ -70,9 +70,8 @@ test-all:
test-launch-postgres:
@docker rm -f test-postgres || true
docker run -d --name test-postgres -p 5432:5432 postgres
while ! nc -z 127.0.0.1 5432; do sleep 1; done
sleep 2
docker run -d --name test-postgres -p 5432:5432 healthcheck/postgres
while ! docker inspect --format='{{json .State.Health}}' test-postgres|grep 'Status":"healthy"'; do sleep 1; done
test-postgres: test-launch-postgres
./manage.py test $(MODULE) --settings=mayan.settings.testing.docker.db_postgres --nomigrations
@@ -82,9 +81,8 @@ test-postgres-all: test-launch-postgres
test-launch-mysql:
@docker rm -f test-mysql || true
docker run -d --name test-mysql -p 3306:3306 -e MYSQL_ALLOW_EMPTY_PASSWORD=True -e MYSQL_DATABASE=mayan mysql
while ! nc -z 127.0.0.1 3306; do sleep 1; done
sleep 10
docker run -d --name test-mysql -p 3306:3306 -e MYSQL_ALLOW_EMPTY_PASSWORD=True -e MYSQL_DATABASE=mayan healthcheck/mysql
while ! docker inspect --format='{{json .State.Health}}' test-mysql|grep 'Status":"healthy"'; do sleep 1; done
test-mysql: test-launch-mysql
./manage.py test $(MODULE) --settings=mayan.settings.testing.docker.db_mysql --nomigrations