Skip to content

Conversation

@rhnvrm
Copy link
Member

@rhnvrm rhnvrm commented Sep 27, 2025

Summary

Add comprehensive local testing infrastructure using Docker Compose to run tests against PostgreSQL and MySQL databases.

Changes

New Files

  • scripts/test.sh - Unified test script for setup/run/cleanup modes
  • docker-compose.test.yml - Docker services (Redis, PostgreSQL, MySQL)

Modified Files

  • Makefile - Added test targets: test-local, test-setup, test-run, test-cleanup
  • README.md - Added Local Testing section with quick start guide
  • .github/workflows/test.yml - Improved MySQL authentication

Usage

# Run all tests
make test-local

# Test specific databases  
make test-postgres
make test-mysql

# Manual control
make test-setup    # Start services
make test-run      # Run tests
make test-cleanup  # Stop services

The script automatically detects CI vs local environments and handles service health checks.

Test Plan

  • Verify make test-local works end-to-end
  • Test individual database targets
  • Verify GitHub workflow compatibility
  • Check cleanup removes all containers properly

Add unified testing solution that works seamlessly in both local and CI environments:

- Unified test script with multiple modes (setup/run/cleanup/all)
- Docker Compose configuration for all required services
- Enhanced Makefile with convenient test targets
- Comprehensive documentation in README
- Improved GitHub workflow reliability

Features:
- Environment-aware script (detects CI vs local)
- Support for testing specific databases or all
- Health checks and proper error handling
- Verbose output for debugging
- No drift between local and CI testing

Local testing is now as simple as: make test-local
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant