From 5884f9341ed5c432012df81ccc09262bcc22990a Mon Sep 17 00:00:00 2001 From: Carlos Santos <4a.santos@gmail.com> Date: Fri, 30 May 2025 11:27:05 +0200 Subject: [PATCH] ci: remove wait-on installation from integration and unit test workflows, update wait logic in E2E test workflow --- .../workflows/backend-integration-test.yaml | 14 --------- .github/workflows/backend-unit-test.yaml | 2 -- .github/workflows/wc-e2e-test.yaml | 30 ++++++++++--------- 3 files changed, 16 insertions(+), 30 deletions(-) diff --git a/.github/workflows/backend-integration-test.yaml b/.github/workflows/backend-integration-test.yaml index cb69344..d906d1e 100644 --- a/.github/workflows/backend-integration-test.yaml +++ b/.github/workflows/backend-integration-test.yaml @@ -10,8 +10,6 @@ jobs: uses: actions/setup-node@v4 with: node-version: '20' - - name: Install wait-on - run: npm install -g wait-on - name: Install LK CLI run: curl -sSL https://get.livekit.io/cli | bash - name: Setup OpenVidu Local Deployment @@ -44,8 +42,6 @@ jobs: uses: actions/setup-node@v4 with: node-version: '20' - - name: Install wait-on - run: npm install -g wait-on - name: Install LK CLI run: curl -sSL https://get.livekit.io/cli | bash - name: Setup OpenVidu Local Deployment @@ -77,8 +73,6 @@ jobs: uses: actions/setup-node@v4 with: node-version: '20' - - name: Install wait-on - run: npm install -g wait-on - name: Install LK CLI run: curl -sSL https://get.livekit.io/cli | bash - name: Setup OpenVidu Local Deployment @@ -110,8 +104,6 @@ jobs: uses: actions/setup-node@v4 with: node-version: '20' - - name: Install wait-on - run: npm install -g wait-on - name: Install LK CLI run: curl -sSL https://get.livekit.io/cli | bash - name: Setup OpenVidu Local Deployment @@ -143,8 +135,6 @@ jobs: uses: actions/setup-node@v4 with: node-version: '20' - - name: Install wait-on - run: npm install -g wait-on - name: Install LK CLI run: curl -sSL https://get.livekit.io/cli | bash - name: Setup OpenVidu Local Deployment @@ -176,8 +166,6 @@ jobs: uses: actions/setup-node@v4 with: node-version: '20' - - name: Install wait-on - run: npm install -g wait-on - name: Install LK CLI run: curl -sSL https://get.livekit.io/cli | bash - name: Setup OpenVidu Local Deployment @@ -209,8 +197,6 @@ jobs: uses: actions/setup-node@v4 with: node-version: '20' - - name: Install wait-on - run: npm install -g wait-on - name: Install LK CLI run: curl -sSL https://get.livekit.io/cli | bash - name: Setup OpenVidu Local Deployment diff --git a/.github/workflows/backend-unit-test.yaml b/.github/workflows/backend-unit-test.yaml index dfd6bf6..518c00f 100644 --- a/.github/workflows/backend-unit-test.yaml +++ b/.github/workflows/backend-unit-test.yaml @@ -10,8 +10,6 @@ jobs: uses: actions/setup-node@v4 with: node-version: '20' - - name: Install wait-on - run: npm install -g wait-on - name: Setup OpenVidu Meet uses: OpenVidu/actions/start-openvidu-meet@main - name: Run tests diff --git a/.github/workflows/wc-e2e-test.yaml b/.github/workflows/wc-e2e-test.yaml index 3f63bfb..2e292fc 100644 --- a/.github/workflows/wc-e2e-test.yaml +++ b/.github/workflows/wc-e2e-test.yaml @@ -10,27 +10,31 @@ jobs: uses: actions/setup-node@v4 with: node-version: '20' - - name: Install wait-on - run: npm install -g wait-on - name: Setup OpenVidu Local Deployment uses: OpenVidu/actions/start-openvidu-local-deployment@main - name: Setup OpenVidu Meet - shell: bash - run: | - ./prepare.sh - cd backend - npm run start:prod > ../backend.log 2>&1 & + uses: OpenVidu/actions/start-openvidu-meet@main env: MEET_WEBHOOK_ENABLED: true - - name: Wait for OpenVidu Meet to Start - run: wait-on --timeout 30000 http://localhost:6080/meet/health - name: Start testapp shell: bash run: | cd testapp npm run start > ../testapp.log 2>&1 & - name: Wait for testapp to Start - run: wait-on --timeout 30000 http://localhost:5080 + shell: bash + run: | + echo "Waiting for testapp to start on http://localhost:5080..." + for i in {1..30}; do + if curl -s http://localhost:5080 >/dev/null 2>&1; then + echo "Testapp is ready!" + exit 0 + fi + echo "Attempt $i/30: Testapp not ready yet, waiting 1 second..." + sleep 1 + done + echo "Timeout: Testapp failed to start within 30 seconds" + exit 1 - name: Run tests run: | docker ps -a @@ -42,14 +46,12 @@ jobs: env: RUN_MODE: CI PLAYWRIGHT_BROWSERS_PATH: /tmp/ms-playwright - - name: Upload OpenVidu Meet logs + - name: Upload OpenVidu Testapp logs if: always() uses: actions/upload-artifact@v4 with: name: meet-logs - path: | - backend.log - testapp.log + path: testapp.log retention-days: 2 - name: Upload failed test videos if: always()