Skip to content

Commit

Permalink
fixing tests
Browse files Browse the repository at this point in the history
  • Loading branch information
kylevillegas93 committed Oct 24, 2024
1 parent 1f1b1a0 commit 7bcd36b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 47 deletions.
9 changes: 7 additions & 2 deletions .github/workflows/Playwright.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
45 changes: 0 additions & 45 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 7bcd36b

Please sign in to comment.