From c7c8d75343654742540b616678fa3b945ceba241 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20L=C3=BCck?= Date: Tue, 7 May 2024 17:04:08 +0200 Subject: [PATCH] Improve tests to await port being open --- .github/workflows/ci.yml | 1 + tests/await.bash | 16 ++++++++++++++++ 2 files changed, 17 insertions(+) create mode 100755 tests/await.bash diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5310f05..d73b148 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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 "actions@github.com" - run: git config --global url."https://${{ github.actor }}:${{ secrets.GITHUB_TOKEN }}@github.com/".insteadOf "https://github.com/" diff --git a/tests/await.bash b/tests/await.bash new file mode 100755 index 0000000..7b098b6 --- /dev/null +++ b/tests/await.bash @@ -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