Skip to content

Latest commit

Β 

History

History
92 lines (69 loc) Β· 2.21 KB

File metadata and controls

92 lines (69 loc) Β· 2.21 KB

Smoke Tests - Quick Reference

πŸš€ Quick Start

Run Locally

cd backend
npm run test:smoke

Setup Test User (One-time per environment)

export SUPABASE_URL="your-url"
export SUPABASE_SERVICE_ROLE_KEY="your-key"
export SMOKE_TEST_USER_EMAIL="smoke-test@syncro.test"
export SMOKE_TEST_USER_PASSWORD="SecurePassword123!"
npm run setup:smoke-user

πŸ“‹ Required Secrets (GitHub Actions)

Secret Description Example
SMOKE_TEST_USER_EMAIL Test user email smoke-test@syncro.test
SMOKE_TEST_USER_PASSWORD Test user password SecurePassword123!
BACKEND_URL Backend API URL https://api.syncro.app
NEXT_PUBLIC_SUPABASE_URL Supabase URL https://xxx.supabase.co
NEXT_PUBLIC_SUPABASE_ANON_KEY Supabase anon key eyJhbG...

βœ… What's Tested

  • βœ… Login flow
  • βœ… Dashboard access
  • βœ… Subscription list
  • βœ… API health endpoints
  • βœ… Payment/billing APIs
  • βœ… Security & authentication
  • βœ… Database connectivity

πŸ”§ Common Commands

# Run all smoke tests
npm run test:smoke

# Run with verbose output
npm run test:smoke:verbose

# Run specific test
npm run test:smoke -- --testNamePattern="Authentication"

# Setup smoke test user
npm run setup:smoke-user

πŸ› Troubleshooting

Issue Solution
Missing env vars Check GitHub secrets or local .env
Auth failed Verify test user exists, run setup:smoke-user
Timeout Increase wait time or check service status
RLS test failed Expected - RLS should block cross-user access

πŸ“Š Success Criteria

  • All tests pass βœ…
  • Execution time < 2 minutes ⏱️
  • No authentication errors πŸ”
  • All critical paths verified πŸ›£οΈ

🚨 When Tests Fail

Staging:

  • PR comment added with details
  • Review workflow logs
  • Fix before merging

Production:

  • GitHub issue created automatically
  • Labeled critical, production
  • Consider rollback immediately

πŸ“– Full Documentation

See SMOKE_TESTS.md for complete details.

πŸ”— Related