Skip to content

Commit

Permalink
Improve tests to await port being open
Browse files Browse the repository at this point in the history
  • Loading branch information
clue committed May 7, 2024
1 parent 054f117 commit c7c8d75
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
1 change: 1 addition & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ jobs:
coverage: none
- run: make
- run: make served
- run: bash tests/await.bash http://clue.localhost/
- run: make test
- run: git config --global user.name "GitHub Actions" && git config --global user.email "[email protected]"
- run: git config --global url."https://${{ github.actor }}:${{ secrets.GITHUB_TOKEN }}@github.com/".insteadOf "https://github.com/"
Expand Down
16 changes: 16 additions & 0 deletions tests/await.bash
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/bin/bash

# @copyright Copyright (c) 2024 Christian Lück, taken from https://github.com/clue/framework-x/pull/3 with permission

base=${1:-http://clue.localhost/}
base=${base%/}

for i in {1..600}
do
out=$(curl -v -X PROBE $base/ 2>&1) && exit 0 || echo -n .
sleep 0.1
done

echo
echo "$out"
exit 1

0 comments on commit c7c8d75

Please sign in to comment.