Skip to content

Commit

Permalink
switch back to url-health-check-action
Browse files Browse the repository at this point in the history
  • Loading branch information
ballPointPenguin committed Oct 8, 2024
1 parent 96d735f commit cd3acdc
Showing 1 changed file with 26 additions and 19 deletions.
45 changes: 26 additions & 19 deletions .github/workflows/cypress-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,25 +29,32 @@ jobs:
run: |
docker compose -f docker-compose.yml -f docker-compose.test.yml --env-file test.env --profile postgres up -d --build
- name: Wait for application to be ready
run: |
timeout=300
start_time=$(date +%s)
while true; do
response=$(curl -s -o /dev/null -w "%{http_code}" http://localhost/api/v3/testConnection)
if [ $response -eq 200 ]; then
echo "Application is ready!"
break
fi
current_time=$(date +%s)
elapsed=$((current_time - start_time))
if [ $elapsed -ge $timeout ]; then
echo "Timeout waiting for application to be ready. Dumping logs:"
docker compose -f docker-compose.yml -f docker-compose.test.yml --env-file test.env --profile postgres logs
exit 1
fi
sleep 5
done
- name: Health Check the Server http response
uses: jtalk/url-health-check-action@v4
with:
url: http://localhost/api/v3/testConnection
max-attempts: 10
retry-delay: 10s

# - name: Wait for application to be ready
# run: |
# timeout=300
# start_time=$(date +%s)
# while true; do
# response=$(curl -s -o /dev/null -w "%{http_code}" http://localhost/api/v3/testConnection)
# if [ $response -eq 200 ]; then
# echo "Application is ready!"
# break
# fi
# current_time=$(date +%s)
# elapsed=$((current_time - start_time))
# if [ $elapsed -ge $timeout ]; then
# echo "Timeout waiting for application to be ready. Dumping logs:"
# docker compose -f docker-compose.yml -f docker-compose.test.yml --env-file test.env --profile postgres logs
# exit 1
# fi
# sleep 5
# done

- name: Cypress Run
uses: cypress-io/github-action@v6
Expand Down

0 comments on commit cd3acdc

Please sign in to comment.