Skip to content

Commit

Permalink
#377 FIX: Decouple tests into individual files (#428)
Browse files Browse the repository at this point in the history
fixes #377 

- separated the jest and e2e test files
- disabled the e2e test workflow for now

## SCREENSHOT
![CleanShot 2024-07-17 at 12 20
42](https://github.com/user-attachments/assets/0892b2ed-4e80-4193-8666-e8aab0ada111)
  • Loading branch information
chris-nowicki authored Jul 17, 2024
1 parent 67a1387 commit 25ffe5f
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 33 deletions.
38 changes: 5 additions & 33 deletions .github/workflows/ci.yml → .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
@@ -1,38 +1,10 @@
name: LGT Jest & Playwright Tests
name: E2E Tests

on:
pull_request:
types: [opened, synchronize, reopened]

jobs:
jest-test:
runs-on: ubuntu-latest
env:
NEXT_PUBLIC_APPWRITE_API_URL: ${{ secrets.NEXT_PUBLIC_APPWRITE_API_URL }}
NEXT_PUBLIC_APPWRITE_PROJECT_ID: ${{ secrets.NEXT_PUBLIC_APPWRITE_PROJECT_ID }}
NEXT_PUBLIC_APPWRITE_DATABASE_ID: ${{ secrets.NEXT_PUBLIC_APPWRITE_DATABASE_ID }}
APPWRITE_API_KEY: ${{ secrets.APPWRITE_API_KEY }}
strategy:
matrix:
node-version: ['20.x']

steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
with:
version: 9

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'pnpm'

- name: Install dependencies
run: pnpm install
- name: tests
run: pnpm test

test-e2e-setup:
name: Setup E2E Tests
runs-on: ubuntu-latest
Expand All @@ -49,9 +21,9 @@ jobs:
- name: Get URL
run: echo "https://${{ steps.vercel_preview_url.outputs.preview_url }}"

test_e2e:
test-e2e:
needs: test-e2e-setup
name: Playwright Tests
name: E2E Tests
timeout-minutes: 5
runs-on: ubuntu-latest
env:
Expand All @@ -64,8 +36,8 @@ jobs:
with:
node-version: lts/*
- run: npm install -g pnpm && pnpm install
- run: pnpm exec playwright install --with-deps
- run: pnpm exec playwright test
- run: pnpm exec playwright install --with-deps
- run: pnpm exec playwright test
- name: Upload Artifacts
uses: actions/upload-artifact@v4
if: always()
Expand Down
34 changes: 34 additions & 0 deletions .github/workflows/jest.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Jest Unit Tests

on:
pull_request:
types: [opened, synchronize, reopened]

jobs:
jest-test:
runs-on: ubuntu-latest
env:
NEXT_PUBLIC_APPWRITE_API_URL: ${{ secrets.NEXT_PUBLIC_APPWRITE_API_URL }}
NEXT_PUBLIC_APPWRITE_PROJECT_ID: ${{ secrets.NEXT_PUBLIC_APPWRITE_PROJECT_ID }}
NEXT_PUBLIC_APPWRITE_DATABASE_ID: ${{ secrets.NEXT_PUBLIC_APPWRITE_DATABASE_ID }}
APPWRITE_API_KEY: ${{ secrets.APPWRITE_API_KEY }}
strategy:
matrix:
node-version: ['20.x']

steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
with:
version: 9

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'pnpm'

- name: Install dependencies
run: pnpm install
- name: tests
run: pnpm test

0 comments on commit 25ffe5f

Please sign in to comment.