[Docker] Wait until elasticsearch is up for tests

This commit is contained in:
Earlopain 2022-03-28 17:51:53 +02:00
parent 5180d313ef
commit 36df31eb74
No known key found for this signature in database
GPG Key ID: 6CFB948E15246897
2 changed files with 7 additions and 1 deletions

View File

@ -44,7 +44,7 @@ services:
- redis
- memcached
- elastic
entrypoint: ["bundle", "exec", "rails", "test"]
entrypoint: ["docker/test_runner.sh"]
profiles:
- test

6
docker/test_runner.sh Executable file
View File

@ -0,0 +1,6 @@
#! /bin/sh
set -e
echo "Waiting for elastic to come up"
timeout 20 sh -c 'until nc -z elastic 9200; do sleep 1; done'
bundle exec rails test "$@"