Skip to content

Prioritize native database installations over Docker#4302

Open
kyleconroy wants to merge 1 commit intomainfrom
claude/prefer-native-sqltest-3gWyN
Open

Prioritize native database installations over Docker#4302
kyleconroy wants to merge 1 commit intomainfrom
claude/prefer-native-sqltest-3gWyN

Conversation

@kyleconroy
Copy link
Collaborator

Summary

This change reorders the database server startup logic to prioritize native installations over Docker containers in the SQL test utilities for both MySQL and PostgreSQL.

Key Changes

  • MySQL tests (internal/sqltest/local/mysql.go):

    • Swapped the order of checks: now attempts native installation first, then falls back to Docker
    • Updated fallback comment to reflect the new priority
  • PostgreSQL tests (internal/sqltest/local/postgres.go):

    • Applied the same reordering: native installation checked first, Docker as fallback
    • Updated fallback comment to reflect the new priority
  • Skip messages: Updated error messages in both files to reflect the new priority order (native before Docker)

Rationale

This change ensures that native database installations are preferred when available, as they typically offer better performance and lower overhead compared to Docker containers. Docker is now used as a fallback option only when native installations are not available.

https://claude.ai/code/session_01XbZNE4YfrtML4B6sLVf2E3

Change the database selection order in local/postgres.go and
local/mysql.go to try native installations first and fall back
to Docker, instead of the previous Docker-first ordering. This
better suits environments where databases are installed natively
(e.g., CI or remote development), avoiding unnecessary Docker
overhead.

https://claude.ai/code/session_01XbZNE4YfrtML4B6sLVf2E3
@dosubot dosubot bot added size:S This PR changes 10-29 lines, ignoring generated files. 🔧 golang labels Feb 18, 2026
@rubensantoniorosa2704
Copy link
Contributor

Hey, I was looking at the CI failures and noticed something interesting. Looking at the logs, MySQL tests are all failing with:

INFO native/mysql status="starting existing service"
MySQL is not installed or could not be started

And for PostgreSQL there's a different failure:

failed SASL auth: FATAL: password authentication failed for user "postgres"

I also took a look at ci.yml and didn't see any database setup steps. I'm curious — was the fallback to Docker tested in the CI environment after this change? The logs suggest it might not be kicking in as expected.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:S This PR changes 10-29 lines, ignoring generated files. 🔧 golang

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

Comments