This repository contains test cases and scenarios for PostgreSQL and MySQL databases. It’s designed to help developers test various database features, behaviors, and edge cases across different versions.
.
├── tests/ # Test cases directory
│ ├── postgresql/ # PostgreSQL test cases
│ │ └── length_test/ # Tests for string length functions
│ └── mysql/ # MySQL test cases
│ └── length_test/ # Tests for string length functions
├── scripts/ # Utility scripts
│ ├── run_containers.sh # Container management script
│ ├── run_sql.sh # SQL execution script
│ └── common.sh # Common functions for scripts
├── results/ # Test results and logs
├── docker-compose.yml # Container configuration
├── .gitignore # Git ignore rules
├── .cursorignore # Cursor IDE ignore rules
└── LICENSE # MIT License file
Basic Operations
Advanced Features
Edge Cases
Start the required database container:
# Using Docker (default)
./scripts/run_containers.sh start postgres_17_test # For PostgreSQL 17
# or
./scripts/run_containers.sh start mysql_9_test # For MySQL 9
# Using Podman
CONTAINER_RUNTIME=podman ./scripts/run_containers.sh start postgres_17_test
Execute SQL test files:
# Run PostgreSQL test
./scripts/run_sql.sh tests/postgresql/length_test/length_test.sql postgres 17
# Run MySQL test
./scripts/run_sql.sh tests/mysql/length_test/length_test.sql mysql 9
The script will:
Check test results:
# View PostgreSQL test results
ls -l results/postgresql/version_17/
# View MySQL test results
ls -l results/mysql/version_9/
Test results are saved in the following format:
results/
├── postgresql/
│ └── version_17/
│ └── length_test_YYYYMMDD_HHMMSS.log
└── mysql/
└── version_9/
└── length_test_YYYYMMDD_HHMMSS.log
Stop containers when done:
./scripts/run_containers.sh stop postgres_17_test # Stop PostgreSQL 17
# or
./scripts/run_containers.sh stop mysql_9_test # Stop MySQL 9
The repository includes a container management script (scripts/run_containers.sh) with the following commands:
./scripts/run_containers.sh help # Show help
./scripts/run_containers.sh start # Start containers
./scripts/run_containers.sh stop # Stop containers
./scripts/run_containers.sh status # Show container status
./scripts/run_containers.sh logs # View container logs
./scripts/run_containers.sh list # List available containers
Test Isolation
Documentation
Version Compatibility
Security
Performance
When adding new test cases:
Common issues and solutions:
Container won’t start
Database connection issues
Test failures
This project is licensed under the MIT License - see the LICENSE file for details.