Skip to content

Commit

Permalink
wait for fauna to come up for integ tests (#369)
Browse files Browse the repository at this point in the history
  • Loading branch information
fauna-chase authored Nov 1, 2023
1 parent 3ad29ef commit b7365af
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 4 deletions.
16 changes: 16 additions & 0 deletions concourse/scripts/wait-for-it.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
attempt_counter=0
max_attempts=100

echo "waiting for $1"
until $(curl -m 1 --output /dev/null --silent --head --fail $1); do
if [ ${attempt_counter} -eq ${max_attempts} ];then
echo ""
echo "Max attempts reached to $1"
exit 1
fi

printf '.'
attempt_counter=$(($attempt_counter+1))
sleep 5
done
echo "$1 is up and running!"
32 changes: 28 additions & 4 deletions concourse/tasks/integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,13 @@ services:
volumes:
- "../../:/tmp/app"
working_dir: "/tmp/app"
command: [sh, -c, "ls -la && sbt ++2.11.12 -Dsbt.supershell=false test"]
command:
- sh
- -c
- |
ls -la
concourse/scripts/wait-for-it.sh http://faunadb:8443/ping
sbt ++2.11.12 -Dsbt.supershell=false test
tests-jdk-11-scala-2.12:
environment:
Expand All @@ -38,7 +44,13 @@ services:
volumes:
- "../../:/tmp/app"
working_dir: "/tmp/app"
command: [sh, -c, "ls -la && sbt ++2.12.14 -Dsbt.supershell=false test"]
command:
- sh
- -c
- |
ls -la
concourse/scripts/wait-for-it.sh http://faunadb:8443/ping
sbt ++2.12.14 -Dsbt.supershell=false test
tests-oracle-jdk-11-scala-2.11:
environment:
Expand All @@ -56,7 +68,13 @@ services:
volumes:
- "../../:/tmp/app"
working_dir: "/tmp/app"
command: [sh, -c, "ls -la && sbt ++2.11.12 -Dsbt.supershell=false test"]
command:
- sh
- -c
- |
ls -la
concourse/scripts/wait-for-it.sh http://faunadb:8443/ping
sbt ++2.11.12 -Dsbt.supershell=false test
tests-oracle-jdk-11-scala-2.12:
environment:
Expand All @@ -74,4 +92,10 @@ services:
volumes:
- "../../:/tmp/app"
working_dir: "/tmp/app"
command: [sh, -c, "ls -la && sbt ++2.12.14 -Dsbt.supershell=false test"]
command:
- sh
- -c
- |
ls -la
concourse/scripts/wait-for-it.sh http://faunadb:8443/ping
sbt ++2.12.14 -Dsbt.supershell=false test

0 comments on commit b7365af

Please sign in to comment.