From 7bcd36b9961325664d631b309750b589f303fabf Mon Sep 17 00:00:00 2001 From: kyle Date: Thu, 24 Oct 2024 12:23:17 -0400 Subject: [PATCH] fixing tests --- .github/workflows/Playwright.yml | 9 +++++-- .github/workflows/ci.yml | 45 -------------------------------- 2 files changed, 7 insertions(+), 47 deletions(-) diff --git a/.github/workflows/Playwright.yml b/.github/workflows/Playwright.yml index e598e1e3..34533b5f 100644 --- a/.github/workflows/Playwright.yml +++ b/.github/workflows/Playwright.yml @@ -33,10 +33,15 @@ jobs: - name: Wait for the app run: | - until curl --output /dev/null --silent --head --fail http://localhost:3000; do + RETRIES=6 + until curl --output /dev/null --silent --head --fail http://localhost:3000 || [ $((RETRIES--)) -eq 0 ]; do echo "Waiting for server..." - sleep 2 + sleep 5 done + if [ $RETRIES -lt 0 ]; then + echo "Server failed to start within the timeout period." + exit 1 + fi shell: bash - name: Run your tests diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b3501dea..486eabe3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -123,51 +123,6 @@ jobs: - name: Test run: npm run test - playwright_test: - name: Playwright Integration Tests - runs-on: ubuntu-latest - container: - image: mcr.microsoft.com/playwright:v1.46.0-jammy - env: - CI: true - steps: - - uses: actions/checkout@v4 - - - name: Setup Node - uses: actions/setup-node@v4 - with: - node-version-file: ".nvmrc" - cache: npm - - - name: Cache node modules - uses: actions/cache@v4 - env: - cache-name: cache-node-modules - with: - # npm cache files are stored in `~/.npm` on Linux/macOS - path: ~/.npm - key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }} - restore-keys: | - ${{ runner.os }}-build-${{ env.cache-name }}- - ${{ runner.os }}-build- - ${{ runner.os }}- - - - name: Install Dependencies - run: npm ci - - - name: Build app - run: NODE_ENV=test npm run build - - - name: Test - run: npm run playwright - - - uses: actions/upload-artifact@v4 - if: always() - with: - name: playwright-report - path: /playwright-report/ - retention-days: 4 - docker_build: # Don't push anything to ECR, just build the docker image to make sure there are no build failures name: Build Docker Image