From 4854098cfb8e2fc9ca944eccca91bfd56759e841 Mon Sep 17 00:00:00 2001 From: SamTV12345 <40429738+samtv12345@users.noreply.github.com> Date: Sun, 10 Mar 2024 21:42:44 +0100 Subject: [PATCH] Fixed waiting. --- .github/workflows/frontend-admin-tests.yml | 35 +++++++++++++++++++++- 1 file changed, 34 insertions(+), 1 deletion(-) diff --git a/.github/workflows/frontend-admin-tests.yml b/.github/workflows/frontend-admin-tests.yml index 875ac78b0..33217e6e2 100644 --- a/.github/workflows/frontend-admin-tests.yml +++ b/.github/workflows/frontend-admin-tests.yml @@ -92,6 +92,22 @@ jobs: run: | pnpm install pnpm run build + - + uses: saucelabs/sauce-connect-action@v2.3.6 + with: + username: ${{ secrets.SAUCE_USERNAME }} + accessKey: ${{ secrets.SAUCE_ACCESS_KEY }} + tunnelIdentifier: ${{ steps.sauce_strings.outputs.tunnel_id }} + # name: Run the frontend admin tests + # shell: bash + # env: + # SAUCE_USERNAME: ${{ secrets.SAUCE_USERNAME }} + # SAUCE_ACCESS_KEY: ${{ secrets.SAUCE_ACCESS_KEY }} + # SAUCE_NAME: ${{ steps.sauce_strings.outputs.name }} + # TRAVIS_JOB_NUMBER: ${{ steps.sauce_strings.outputs.tunnel_id }} + # GIT_HASH: ${{ steps.environment.outputs.sha_short }} + # run: | + # src/tests/frontend/travis/adminrunner.sh #- # uses: saucelabs/sauce-connect-action@v2.3.6 # with: @@ -110,9 +126,26 @@ jobs: # run: | # src/tests/frontend/travis/adminrunner.sh - name: Run the frontend admin tests + shell: bash + env: + SAUCE_USERNAME: ${{ secrets.SAUCE_USERNAME }} + SAUCE_ACCESS_KEY: ${{ secrets.SAUCE_ACCESS_KEY }} + SAUCE_NAME: ${{ steps.sauce_strings.outputs.name }} + TRAVIS_JOB_NUMBER: ${{ steps.sauce_strings.outputs.tunnel_id }} + GIT_HASH: ${{ steps.environment.outputs.sha_short }} run: | pnpm run dev & - sleep 20 + log "Waiting for Etherpad to accept connections (http://localhost:9001)..." + connected=false + can_connect() { + curl -sSfo /dev/null http://localhost:9001/ || return 1 + connected=true + } + now() { date +%s; } + start=$(now) + while [ $(($(now) - $start)) -le 15 ] && ! can_connect; do + sleep 1 + done cd src pnpm exec playwright install pnpm run test-admin