Test Environment Setup
Overview
Ocean is a cloud-first application. We do NOT use local environments or local Supabase instances. All development and testing is done against remote cloud services.
Environment Variables
Where NOT to Store Credentials
- ❌
.env.local- This file is NOT used. It contains deprecated credentials. - ❌ Hardcoded in test files - Never hardcode any credentials
- ❌ Git repository - Never commit credentials
Where to Store Credentials
- GitHub Secrets - For CI/CD pipeline
- Supabase Secrets - For Edge Functions
- Vercel Environment Variables - For deployment
.env.test- For local test runs only (never commit)
Setting Up Tests Locally
- Copy the example file:
cp .env.test.example .env.test
-
Get the modern Supabase credentials from the dashboard:
- Publishable Key: Starts with
pk_(safe for client-side) - Service Role Key: Modern JWT token (NOT the deprecated
sb_secret_)
- Publishable Key: Starts with
-
Get Stripe test credentials:
- Use test mode keys (
sk_test_...) - Get webhook secret from Stripe dashboard
- Use test mode keys (
-
Run tests:
./scripts/test-suite/run-all-tests.sh
Important Notes
- We use Supabase's modern JWT security system
- Legacy API keys (starting with
sb_secret_) are deprecated and will not work - All tests run against the remote Supabase instance
- Never use production credentials for testing
CI/CD Testing
Tests run automatically in GitHub Actions using secrets stored in the repository settings. No local setup required for CI/CD.
Troubleshooting
"Legacy API keys are disabled" Error
You're using an old Supabase key. Get the modern JWT keys from the Supabase dashboard.
"No .env.test file found" Warning
Create .env.test from .env.test.example with proper credentials.
Tests Can't Connect
Ensure you're using the correct modern Supabase keys and the remote URL.