Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
83 commits
Select commit Hold shift + click to select a range
eea199b
Add comprehensive unit testing framework
a1ly404 Sep 18, 2025
3fa988b
feat: Improve test coverage from 63.11% to 85.24%
a1ly404 Sep 18, 2025
2889244
refactor: Eliminate code duplication and improve test quality
a1ly404 Sep 18, 2025
d4b54a9
refactor: Replace hardcoded mock data with maintainable constants and…
a1ly404 Sep 18, 2025
c993106
Update package.json
a1ly404 Sep 18, 2025
4abf04d
Update src/test/Bouts.test.tsx
a1ly404 Sep 18, 2025
c644187
Update src/test/setup.ts
a1ly404 Sep 18, 2025
b1c518b
Update src/test/Players.test.tsx
a1ly404 Sep 18, 2025
d401a38
Update src/test/Navigation.test.tsx
a1ly404 Sep 18, 2025
303193d
Update package.json
a1ly404 Sep 18, 2025
b67c595
feat: improve createChainableQuery mock with state tracking
a1ly404 Sep 18, 2025
d538d89
refactor: replace magic numbers with constants and add Vercel Speed I…
a1ly404 Sep 18, 2025
49ac44f
Update src/test/setup.ts
a1ly404 Sep 18, 2025
f1321bd
fix: resolve TypeScript interface mismatch in test setup
a1ly404 Sep 18, 2025
ea8f398
refactor: remove global useAuth mock to prevent test conflicts
a1ly404 Sep 18, 2025
af542b4
docs: update comprehensive test coverage report
a1ly404 Sep 18, 2025
8c609f1
fix: replace deprecated __dirname with ES module equivalent
a1ly404 Sep 18, 2025
709f9a8
Commit coverage html
a1ly404 Sep 18, 2025
140ecbb
Update src/test/setup.ts
a1ly404 Sep 18, 2025
d1cfdc3
Update src/test/setup.ts
a1ly404 Sep 18, 2025
8d6c0eb
Adding github actions to fail on failing tests
a1ly404 Sep 18, 2025
5303674
fix: resolve jsdom compatibility issues in CI environment
a1ly404 Sep 18, 2025
67a20dd
fix: update CI test script to use ES modules
a1ly404 Sep 18, 2025
69d8983
fix: migrate from jsdom to happy-dom for better CI compatibility
a1ly404 Sep 18, 2025
1fa0d5c
docs: add comprehensive testing documentation
a1ly404 Sep 18, 2025
1ebf158
fix: resolve Vitest reporter configuration issues
a1ly404 Sep 18, 2025
6bf16e8
Update .github/workflows/quality-gate.yml
a1ly404 Sep 18, 2025
144fe9f
Update .github/workflows/ci.yml
a1ly404 Sep 18, 2025
ee3f8c2
Standardize all GitHub Actions workflows to Node.js 22
a1ly404 Sep 18, 2025
06a763d
Merge branch 'dev' of https://github.com/a1ly404/derby-stat-tracker i…
a1ly404 Sep 18, 2025
29ec878
Fix GitHub Actions permission error in test-before-deploy workflow
a1ly404 Sep 18, 2025
2ff73e6
Update .github/workflows/test-before-deploy.yml
a1ly404 Sep 18, 2025
f053855
Update .github/workflows/quality-gate.yml
a1ly404 Sep 18, 2025
709f7f0
Update .github/workflows/ci.yml
a1ly404 Sep 18, 2025
443444b
Ran lint:fix
a1ly404 Sep 18, 2025
a1ce6dc
Update .github/workflows/quality-gate.yml
a1ly404 Sep 18, 2025
a9b5937
Merge branch 'main' into dev
a1ly404 Sep 18, 2025
98daccc
Optimize CI/CD pipeline: Use build artifacts instead of rebuilding
a1ly404 Sep 18, 2025
13d55f5
Potential fix for code scanning alert no. 1: Incomplete URL substring…
a1ly404 Sep 18, 2025
23f1305
Potential fix for code scanning alert no. 2: DOM text reinterpreted a…
a1ly404 Sep 18, 2025
983ae75
Potential fix for code scanning alert no. 3: DOM text reinterpreted a…
a1ly404 Sep 18, 2025
1b23718
Fix ESLint unused variable errors in test setup
a1ly404 Sep 18, 2025
0c910e3
Removing trailing whitespace
a1ly404 Sep 18, 2025
7da8997
Update .github/workflows/test-before-deploy.yml
a1ly404 Sep 18, 2025
1ec0b13
Update .github/workflows/quality-gate.yml
a1ly404 Sep 18, 2025
aeb70da
Update .github/workflows/ci.yml
a1ly404 Sep 18, 2025
3e5033f
Add Vercel preview deployment for dev branch
a1ly404 Sep 18, 2025
206837e
Fix Vercel GitHub Action reference
a1ly404 Sep 18, 2025
0881f51
Simplify Vercel deployment: Remove --prebuilt flag
a1ly404 Sep 18, 2025
e9597f3
Update .github/workflows/test-before-deploy.yml
a1ly404 Sep 18, 2025
e1dee16
Update .github/workflows/quality-gate.yml
a1ly404 Sep 18, 2025
87dec2a
Update .github/workflows/ci.yml
a1ly404 Sep 18, 2025
2895645
Fix CI workflow YAML formatting and missing test step
a1ly404 Sep 18, 2025
45c08bf
Fix YAML syntax error in test-before-deploy workflow
a1ly404 Sep 18, 2025
f0f48e9
Revert to amondnet/vercel-action for preview deployment
a1ly404 Sep 18, 2025
ae89de7
Fix preview deployment condition for pull requests
a1ly404 Sep 18, 2025
f8f802a
feat: Complete live derby stat tracking system with bout management
a1ly404 Sep 26, 2025
61aa7fa
refactor: Replace jarring page reload with smooth navigation
a1ly404 Sep 26, 2025
fb97f53
Merge pull request #6 from a1ly404/5-live-tracking
a1ly404 Sep 26, 2025
9e8e487
feat: Add database performance optimization scripts
a1ly404 Sep 26, 2025
93b92ad
Remove coverage folder
a1ly404 Sep 29, 2025
dd98b83
Merge branch 'main' into dev
a1ly404 Sep 29, 2025
56decdb
Respond to pr feedback
a1ly404 Sep 29, 2025
4de4fee
More pr feedback
a1ly404 Sep 29, 2025
d5c8808
Fix dupes on player ids
a1ly404 Sep 29, 2025
dbeb983
more pr feedback
a1ly404 Sep 29, 2025
e371ef7
Lighthouse: Adding in local and production lighthouse ci integration
a1ly404 Sep 30, 2025
b357479
WIP: Working on updating live track
allybeaumont-certn Oct 31, 2025
71242c1
feat: add apps/live-tracker (derby-stats-live-tra spark app) to monorepo
a1ly404 Apr 6, 2026
c2353ef
feat(e2e): add live-tracker Playwright project + tests
a1ly404 Apr 6, 2026
26f76b1
feat: complete monorepo restructure (WIP → committed)
a1ly404 Apr 10, 2026
0337064
feat(e2e): comprehensive e2e coverage with screenshots, video, and CR…
a1ly404 Apr 10, 2026
6a19749
feat: database setup, live-bridge digest, Vite fix, Vercel config, E2…
a1ly404 Apr 10, 2026
60dba6f
Merge main into feat/e2e-coverage: resolve monorepo restructure confl…
a1ly404 Apr 10, 2026
1b57f01
fix: CI failures — update unit tests for monorepo code, fix Lighthous…
a1ly404 Apr 10, 2026
225d335
fix: lint error in test mock, add Chrome setup for Lighthouse CI
a1ly404 Apr 10, 2026
194ef03
fix: remove unused puppeteer require from lighthouse auth script
a1ly404 Apr 10, 2026
47fa087
fix: install LHCI locally so it can resolve puppeteer from local node…
a1ly404 Apr 10, 2026
a796dcd
fix: correct puppeteerScript path — relative to CWD not config file
a1ly404 Apr 10, 2026
ffd0209
fix: replace deprecated page.waitForTimeout with sleep helper
a1ly404 Apr 10, 2026
b94e528
fix: run Vercel preview deploy on all PRs, not just dev branch
a1ly404 Apr 10, 2026
2d0149c
chore: remove Lighthouse CI and Integration Tests workflows
a1ly404 Apr 10, 2026
e2a5ea7
feat(live-tracker): auto-generated API types, live polling, auto-connect
a1ly404 Apr 10, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,16 @@
VITE_SUPABASE_URL=your_supabase_project_url_here
VITE_SUPABASE_ANON_KEY=your_supabase_anon_key_here

# Lighthouse CI Test Credentials (for local testing only)
LIGHTHOUSE_TEST_EMAIL=your_lighthouse_test_email@example.com
LIGHTHOUSE_TEST_PASSWORD=your_lighthouse_test_password

# Instructions:
# 1. Get your Supabase URL and anon key from https://supabase.com/dashboard
# 2. Go to your project > Settings > API
# 3. Copy the "URL" and "anon public" key
# 4. Replace the placeholder values above with your actual keys
# 5. Save this file as .env.local (not .env.example)
# 5. Create a test account for Lighthouse CI and add credentials above
# 6. Save this file as .env.local (not .env.example)

# Note: Never commit .env.local to git - it contains secrets!
317 changes: 213 additions & 104 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,104 +1,213 @@
name: CI/CD Pipeline

on:
push:
branches: [main, dev]
pull_request:
branches: [main, dev]

jobs:
test:
name: Run Tests
runs-on: ubuntu-latest

env:
# Environment variables to help with jsdom compatibility
NODE_OPTIONS: --experimental-vm-modules
FORCE_COLOR: 0

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "22"
cache: "npm"

- name: Install dependencies
run: npm ci

- name: Run linting
run: npm run lint

- name: Run tests
run: npm run test

- name: Generate test coverage
run: npm run test:coverage

build:
name: Build Application
runs-on: ubuntu-latest
needs: test # This ensures build only runs if tests pass

env:
NODE_OPTIONS: --experimental-vm-modules

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "22"
cache: "npm"

- name: Install dependencies
run: npm ci

- name: Build application
run: npm run build

- name: Upload build artifacts
uses: actions/upload-artifact@v4
with:
name: build-files
path: dist/

deploy:
name: Deploy to Vercel Production
runs-on: ubuntu-latest
needs: test # This ensures deployment only runs if tests pass
if: github.ref == 'refs/heads/main' # Only deploy from main branch

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Deploy to Vercel
uses: amondnet/vercel-action@v25
with:
vercel-token: ${{ secrets.VERCEL_TOKEN }}
vercel-org-id: ${{ secrets.VERCEL_ORG_ID }}
vercel-project-id: ${{ secrets.VERCEL_PROJECT_ID }}
vercel-args: "--prod"

deploy-preview:
name: Deploy to Vercel Preview
runs-on: ubuntu-latest
needs: test # This ensures deployment only runs if tests pass
if: github.ref == 'refs/heads/dev' || github.event.pull_request.head.ref == 'dev' # Deploy preview from dev branch or PRs from dev

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Deploy to Vercel Preview
uses: amondnet/vercel-action@v25
with:
vercel-token: ${{ secrets.VERCEL_TOKEN }}
vercel-org-id: ${{ secrets.VERCEL_ORG_ID }}
vercel-project-id: ${{ secrets.VERCEL_PROJECT_ID }}
name: CI/CD Pipeline

on:
push:
branches: [main, dev]
pull_request:
branches: [main, dev]

jobs:
# ─────────────────────────────────────────────
# 1. Unit & component tests (Vitest — apps/web)
# ─────────────────────────────────────────────
test:
name: Unit Tests (apps/web)
runs-on: ubuntu-latest

env:
NODE_OPTIONS: --experimental-vm-modules
FORCE_COLOR: 0

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "22"
cache: "npm"

- name: Install dependencies (workspace root)
run: npm ci

- name: Run linting (all workspaces)
run: npm run lint --workspace=apps/web

- name: Run unit tests
run: npm run test --workspace=apps/web

- name: Generate coverage report
run: npm run test:coverage --workspace=apps/web

- name: Upload coverage artifact
uses: actions/upload-artifact@v4
if: always()
with:
name: coverage-report
path: apps/web/coverage/
retention-days: 7

# ─────────────────────────────────────────────
# 2. Build (apps/web)
# ─────────────────────────────────────────────
build:
name: Build (apps/web)
runs-on: ubuntu-latest
needs: test

env:
NODE_OPTIONS: --experimental-vm-modules
# Provide stub env vars so Vite build doesn't fail on missing Supabase config
VITE_SUPABASE_URL: ${{ secrets.VITE_SUPABASE_URL || 'https://placeholder.supabase.co' }}
VITE_SUPABASE_ANON_KEY: ${{ secrets.VITE_SUPABASE_ANON_KEY || 'placeholder-anon-key' }}

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "22"
cache: "npm"

- name: Install dependencies (workspace root)
run: npm ci

- name: Build web app
run: npm run build --workspace=apps/web

- name: Upload build artifacts
uses: actions/upload-artifact@v4
with:
name: web-build
path: apps/web/dist/
retention-days: 7

# ─────────────────────────────────────────────
# 3. Playwright E2E tests (e2e workspace)
# ─────────────────────────────────────────────
e2e:
name: Playwright E2E Tests
runs-on: ubuntu-latest
needs: build

env:
# Provide enough config so the Vite dev server starts
VITE_SUPABASE_URL: https://placeholder.supabase.co
VITE_SUPABASE_ANON_KEY: placeholder-anon-key
CI: true

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "22"
cache: "npm"

- name: Install dependencies (workspace root)
run: npm ci

- name: Install Playwright browsers
run: npx playwright install --with-deps chromium
working-directory: e2e

- name: Run Playwright tests
run: npm run test --workspace=e2e
env:
BASE_URL: http://localhost:5173

- name: Upload Playwright HTML report
uses: actions/upload-artifact@v4
if: always()
with:
name: playwright-report
path: e2e/playwright-report/
retention-days: 14

- name: Upload Playwright test results (screenshots & videos)
uses: actions/upload-artifact@v4
if: always()
with:
name: playwright-test-results
path: e2e/test-results/
retention-days: 14

- name: Upload visual regression snapshots
uses: actions/upload-artifact@v4
if: always()
with:
name: visual-regression-snapshots
path: e2e/tests/**/*-snapshots/
retention-days: 14

# ─────────────────────────────────────────────
# 4. Type-check live-bridge service
# ─────────────────────────────────────────────
typecheck-bridge:
name: Type Check (services/live-bridge)
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "22"
cache: "npm"

- name: Install dependencies (workspace root)
run: npm ci

- name: Type-check live-bridge
run: npx tsc --noEmit
working-directory: services/live-bridge

# ─────────────────────────────────────────────
# 6. Deploy to Vercel (Production — main branch)
# ─────────────────────────────────────────────
deploy:
name: Deploy to Vercel Production
runs-on: ubuntu-latest
needs: [test, e2e]
if: github.ref == 'refs/heads/main'

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Deploy to Vercel
uses: amondnet/vercel-action@v25
with:
vercel-token: ${{ secrets.VERCEL_TOKEN }}
vercel-org-id: ${{ secrets.VERCEL_ORG_ID }}
vercel-project-id: ${{ secrets.VERCEL_PROJECT_ID }}
vercel-args: "--prod"
# Root directory is configured in Vercel dashboard as apps/web
# vercel.json lives at apps/web/vercel.json

# ─────────────────────────────────────────────
# 7. Deploy to Vercel (Preview — dev branch / PRs)
# ─────────────────────────────────────────────
deploy-preview:
name: Deploy to Vercel Preview
runs-on: ubuntu-latest
needs: [test, e2e]
if: github.event_name == 'pull_request'

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Deploy to Vercel Preview
uses: amondnet/vercel-action@v25
with:
vercel-token: ${{ secrets.VERCEL_TOKEN }}
vercel-org-id: ${{ secrets.VERCEL_ORG_ID }}
vercel-project-id: ${{ secrets.VERCEL_PROJECT_ID }}
Loading
Loading