Skip to content

Commit

Permalink
Merge pull request #57 from daniel-frak/e2e_wait_for_it
Browse files Browse the repository at this point in the history
E2e wait for it
  • Loading branch information
daniel-frak authored May 7, 2022
2 parents 6e6bb34 + bf3dbea commit 9e65e9c
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 184 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/maven.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ jobs:
- name: Start containers
working-directory: docker
run: docker-compose up -d --build && ./wait-for-it.sh localhost:8024 -t 600
run: docker-compose up -d --build && ./wait-until "curl -sLf -o /dev/null http://localhost:8024/auth/realms/master" 600

- name: Install node
uses: actions/setup-node@v1
Expand Down
6 changes: 5 additions & 1 deletion docker/e2e/cypress.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
{
"baseUrl": "http://localhost:8024/auth",
"defaultCommandTimeout": 10000
"defaultCommandTimeout": 10000,
"retries": {
"runMode": 2,
"openMode": 0
}
}
182 changes: 0 additions & 182 deletions docker/wait-for-it.sh

This file was deleted.

17 changes: 17 additions & 0 deletions docker/wait-until
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/usr/bin/env bash

command="${1}"
timeout="${2:-30}"

i=1
until eval "${command}"
do
((i++))

if [ "${i}" -gt "${timeout}" ]; then
echo "command was never successful, aborting due to ${timeout}s timeout!"
exit 1
fi

sleep 1
done

0 comments on commit 9e65e9c

Please # to comment.