Skip to content

Commit c7c8d75

Browse files
committed
Improve tests to await port being open
1 parent 054f117 commit c7c8d75

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed

.github/workflows/ci.yml

+1
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ jobs:
2020
coverage: none
2121
- run: make
2222
- run: make served
23+
- run: bash tests/await.bash http://clue.localhost/
2324
- run: make test
2425
- run: git config --global user.name "GitHub Actions" && git config --global user.email "[email protected]"
2526
- run: git config --global url."https://${{ github.actor }}:${{ secrets.GITHUB_TOKEN }}@github.com/".insteadOf "https://github.com/"

tests/await.bash

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#!/bin/bash
2+
3+
# @copyright Copyright (c) 2024 Christian Lück, taken from https://github.com/clue/framework-x/pull/3 with permission
4+
5+
base=${1:-http://clue.localhost/}
6+
base=${base%/}
7+
8+
for i in {1..600}
9+
do
10+
out=$(curl -v -X PROBE $base/ 2>&1) && exit 0 || echo -n .
11+
sleep 0.1
12+
done
13+
14+
echo
15+
echo "$out"
16+
exit 1

0 commit comments

Comments
 (0)