Skip to content

Conversation

Copilot
Copy link
Contributor

@Copilot Copilot AI commented Aug 20, 2025

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.py following 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-mysql action 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 MysqlDumpConnector with 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 Copilot AI changed the title [WIP] Live tests for MySQL Add live tests for MySQL database connectors Aug 20, 2025
@Copilot Copilot AI requested a review from Archmonger August 20, 2025 09:38
Copilot finished work on behalf of Archmonger August 20, 2025 09:38
@Archmonger
Copy link
Owner

@copilot

  • Use this GitHub actions workflow to setup MySQL in the CI. Check the readme for more context.
  • Refactor mysql_live_tests.py to better mimic the two other live test scripts.

Copy link
Contributor Author

Copilot AI commented Aug 20, 2025

@copilot

I've addressed both requested changes:

  1. 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.

  2. Refactored mysql_live_test.py to 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

@Copilot Copilot AI changed the title Add live tests for MySQL database connectors Add live tests for MySQL database connectors with improved CI integration Aug 20, 2025
Copilot finished work on behalf of Archmonger August 20, 2025 09:46
@kayqueGovetri
Copy link

Hello @Archmonger, the new version of setup-mysql v0.0.4 is now available with the fix!

@Archmonger
Copy link
Owner

Much appreciated!

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.

Live tests for MySQL
3 participants