Add live tests for MySQL connectors
This PR implements comprehensive live functional tests for MySQL database connectors, addressing the gap where MySQL tests were previously only mocked while PostgreSQL and SQLite had full end-to-end testing.
Key Changes
MySQL Live Test Implementation:
- Added
scripts/mysql_live_test.pyfollowing the established PostgreSQL test pattern with subprocess isolation - Implements full backup/restore cycle validation with real MySQL databases
- Supports multiple authentication methods for both CI and local development environments
- Gracefully skips tests when MySQL is unavailable (e.g., Windows environments)
Enhanced CI/CD Integration:
- Updated GitHub Actions workflow to use the cross-platform
setup-mysqlaction instead of manual setup - Provides consistent MySQL 8.0 environment with proper authentication across CI runs
- Maintains compatibility with existing PostgreSQL and SQLite test infrastructure
Framework Integration:
- Extended hatch functional environment with MySQL connector testing commands
- Integrated into the complete test suite via
hatch run functional:all - Added MySQL symbol support to test utilities for consistent visual output
Test Coverage:
- Validates
MysqlDumpConnectorwith actual database operations - Tests database and media backup/restore cycles with data integrity verification
- Includes comprehensive error handling and verbose logging options
Usage Examples
# Test all MySQL connectors
hatch run functional:mysql --all
# Test with verbose output
hatch run functional:mysql --verbose
# Run complete functional test suite
hatch run functional:all
The implementation ensures MySQL connectors receive the same rigorous testing as other database backends, improving reliability and maintaining consistency across the test infrastructure.
Fixes #621.
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.
@copilot
- Use this GitHub actions workflow to setup MySQL in the CI. Check the readme for more context.
- Refactor
mysql_live_tests.pyto better mimic the two other live test scripts.
@copilot
- Use this GitHub actions workflow to setup MySQL in the CI. Check the [readme](https://github.com/kayqueGovetri/setup...
I've addressed both requested changes:
-
Updated CI to use the recommended GitHub Actions workflow: Replaced the manual MySQL setup with
kayqueGovetri/[email protected]action as suggested, with MySQL 8.0 and root password configuration. -
Refactored
mysql_live_test.pyto better mimic the other live test scripts:- Restructured to follow the PostgreSQL pattern more closely with proper class separation
- Added subprocess isolation with
_connector_test_entry()top-level function - Improved error handling and logging consistency
- Enhanced the
_run_all()function to use multiprocessing like PostgreSQL - Better authentication handling for both CI and local development environments
The MySQL live tests now have the same structure and isolation approach as the PostgreSQL tests while maintaining the robust error handling and skipping logic when MySQL is unavailable.
Commit: 2a6a7e0
Hello @Archmonger, the new version of setup-mysql v0.0.4 is now available with the fix!
Much appreciated!