Files
goodgo-platform/.env.test
Ho Ngoc Hai d4652fd0f9 fix(auth): use env-configurable bcrypt rounds to prevent test timeout
HashedPassword.vo.spec.ts was timing out because SALT_ROUNDS=12 is too
expensive for the test runner. Make bcrypt rounds configurable via
BCRYPT_ROUNDS env var (default 12 for production), and set BCRYPT_ROUNDS=4
in vitest config for fast unit tests.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-04-10 23:26:43 +07:00

52 lines
1.8 KiB
Plaintext

# =============================================================================
# GoodGo Platform — Test Environment Variables
# Used by E2E tests (Playwright globalSetup loads this automatically)
# =============================================================================
# Test database — separate from development DB for isolation
DATABASE_URL=postgresql://goodgo:goodgo_secret@localhost:5432/goodgo_test?schema=public
# Services (same as dev, adjust if your test infra differs)
REDIS_URL=redis://localhost:6379
TYPESENSE_HOST=localhost
TYPESENSE_PORT=8108
TYPESENSE_PROTOCOL=http
TYPESENSE_API_KEY=ts_dev_key_change_me
# MinIO
MINIO_ENDPOINT=localhost
MINIO_PORT=9000
MINIO_ACCESS_KEY=test_minio_user
MINIO_SECRET_KEY=test_minio_secret_key_32chars!!
MINIO_BUCKET=goodgo-uploads
# Auth (deterministic secrets for test reproducibility)
JWT_SECRET=e2e-test-jwt-secret-key-minimum-32-chars-long-enough
JWT_REFRESH_SECRET=e2e-test-refresh-secret-key-minimum-32-chars-ok
JWT_EXPIRES_IN=15m
JWT_REFRESH_EXPIRES_IN=7d
NODE_ENV=test
# Bcrypt (fast rounds for test — production uses 12+)
BCRYPT_ROUNDS=4
# OAuth (test stubs)
GOOGLE_CLIENT_ID=test-google-client-id
GOOGLE_CLIENT_SECRET=test-google-client-secret
GOOGLE_CALLBACK_URL=http://localhost:3001/api/v1/auth/google/callback
ZALO_APP_ID=test-zalo-app-id
ZALO_APP_SECRET=test-zalo-app-secret
ZALO_CALLBACK_URL=http://localhost:3001/api/v1/auth/zalo/callback
# Payment (sandbox)
VNPAY_TMN_CODE=TESTCODE
VNPAY_HASH_SECRET=TESTHASHSECRETTESTHASHSECRETTEST
VNPAY_URL=https://sandbox.vnpayment.vn/paymentv2/vpcpay.html
VNPAY_RETURN_URL=http://localhost:3000/payment/return
MOMO_PARTNER_CODE=TEST_MOMO_PARTNER
MOMO_ACCESS_KEY=TEST_MOMO_ACCESS_KEY
MOMO_SECRET_KEY=TEST_MOMO_SECRET_KEY
ZALOPAY_APP_ID=TEST_ZALOPAY_APP
ZALOPAY_KEY1=TEST_ZALOPAY_KEY1
ZALOPAY_KEY2=TEST_ZALOPAY_KEY2