From 6507063d3902a12a1cba35f51c14d96301f54f2d Mon Sep 17 00:00:00 2001 From: Carlos Santos <4a.santos@gmail.com> Date: Thu, 24 Apr 2025 11:53:14 +0200 Subject: [PATCH] backend: add wait step for OpenVidu Meet to ensure readiness before running tests --- .github/workflows/integration-test.yaml | 30 +++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/.github/workflows/integration-test.yaml b/.github/workflows/integration-test.yaml index e6176dc..86dffd7 100644 --- a/.github/workflows/integration-test.yaml +++ b/.github/workflows/integration-test.yaml @@ -53,6 +53,21 @@ jobs: cd backend npm install npm run start:prod & + - name: Wait for OpenVidu Meet to Start + shell: bash + run: | + MAX_WAIT_SECONDS=30 + SECONDS=0 + until curl -s -f -o /dev/null http://localhost:6080; do + if [ $SECONDS -gt $MAX_WAIT_SECONDS ]; then + echo "OpenVidu Meet did not start in $MAX_WAIT_SECONDS seconds" + exit 1 + fi + echo "Waiting for OpenVidu Meet to be ready ..." + sleep 5 + SECONDS=$((SECONDS+5)) + done + echo "OpenVidu Meet started in $SECONDS seconds" - name: Run tests run: | cd backend @@ -117,6 +132,21 @@ jobs: cd backend npm install npm run start:prod & + - name: Wait for OpenVidu Meet to Start + shell: bash + run: | + MAX_WAIT_SECONDS=30 + SECONDS=0 + until curl -s -f -o /dev/null http://localhost:6080; do + if [ $SECONDS -gt $MAX_WAIT_SECONDS ]; then + echo "OpenVidu Meet did not start in $MAX_WAIT_SECONDS seconds" + exit 1 + fi + echo "Waiting for OpenVidu Meet to be ready ..." + sleep 5 + SECONDS=$((SECONDS+5)) + done + echo "OpenVidu Meet started in $SECONDS seconds" - name: Run tests run: | cd backend