feat: add database test safety configuration #14

Closed
david wants to merge 0 commits from feat/database-test-safety into main
Owner

Summary

This PR adds database test safety configuration to ensure tests always run against the development database and removes hardcoded passwords from version control.

Changes

  1. Security: Removed hardcoded database URLs/passwords from version control
  2. Tests: Updated test setup files to load .env.development with override
  3. Scripts: Updated scripts to use environment variables instead of hardcoded values
  4. Docker: Regenerated docker-compose files with environment variable placeholders
  5. Bug Fix: Changed "Best Partner" calculation from win rate to ELO contribution

Testing

  • Unit tests: All 103 tests pass
  • E2E tests: Running against dev database (6/9 passed, 3 failures unrelated to database config)
  • Database cleanup: Working correctly in test teardown

Security Note

The hardcoded password LINGO5row_hiding has been removed from:

  • package.json scripts
  • scripts/cleanup-prod-db.js
  • scripts/check-test-records.js
  • scripts/generate-docker-compose.js
  • playwright.config.ts

All database operations now require explicit environment variables or .env files.

Issue

Closes #13 (Add database test safety configuration)

## Summary This PR adds database test safety configuration to ensure tests always run against the development database and removes hardcoded passwords from version control. ## Changes 1. **Security**: Removed hardcoded database URLs/passwords from version control 2. **Tests**: Updated test setup files to load `.env.development` with override 3. **Scripts**: Updated scripts to use environment variables instead of hardcoded values 4. **Docker**: Regenerated docker-compose files with environment variable placeholders 5. **Bug Fix**: Changed "Best Partner" calculation from win rate to ELO contribution ## Testing - ✅ Unit tests: All 103 tests pass - ✅ E2E tests: Running against dev database (6/9 passed, 3 failures unrelated to database config) - ✅ Database cleanup: Working correctly in test teardown ## Security Note The hardcoded password `LINGO5row_hiding` has been removed from: - `package.json` scripts - `scripts/cleanup-prod-db.js` - `scripts/check-test-records.js` - `scripts/generate-docker-compose.js` - `playwright.config.ts` All database operations now require explicit environment variables or `.env` files. ## Issue Closes #13 (Add database test safety configuration)
david added 7 commits 2026-04-01 01:43:30 +00:00
david closed this pull request 2026-04-01 01:44:18 +00:00

Pull request closed

Sign in to join this conversation.