Skip to content

Conversation

@kyleconroy
Copy link
Collaborator

Add a new native package (internal/sqltest/native/) that can install and
start PostgreSQL and MySQL servers directly on Linux systems without
requiring Docker. This enables running end-to-end tests in environments
where Docker is not available (e.g., CI environments without Docker).

Key changes:

  • Add internal/sqltest/native/ package with support for:
    • PostgreSQL installation and startup via apt-get and systemctl/pg_ctlcluster
    • MySQL installation and startup via apt-get and systemctl/service
    • Graceful fallback when installation fails (e.g., no network)
  • Update internal/sqltest/local/ to fall back to native installation
    when Docker is not available
  • Update internal/endtoend/endtoend_test.go to:
    • Check environment variables first (POSTGRESQL_SERVER_URI, MYSQL_SERVER_URI)
    • Fall back to Docker, then native installation
    • Skip database-specific tests when that database is unavailable
    • Support partial database availability (run with just PostgreSQL)

🤖 Generated with Claude Code

Co-Authored-By: Claude noreply@anthropic.com

Add a new native package (internal/sqltest/native/) that can install and
start PostgreSQL and MySQL servers directly on Linux systems without
requiring Docker. This enables running end-to-end tests in environments
where Docker is not available (e.g., CI environments without Docker).

Key changes:
- Add internal/sqltest/native/ package with support for:
  - PostgreSQL installation and startup via apt-get and systemctl/pg_ctlcluster
  - MySQL installation and startup via apt-get and systemctl/service
  - Graceful fallback when installation fails (e.g., no network)
- Update internal/sqltest/local/ to fall back to native installation
  when Docker is not available
- Update internal/endtoend/endtoend_test.go to:
  - Check environment variables first (POSTGRESQL_SERVER_URI, MYSQL_SERVER_URI)
  - Fall back to Docker, then native installation
  - Skip database-specific tests when that database is unavailable
  - Support partial database availability (run with just PostgreSQL)

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
@dosubot dosubot bot added size:XL This PR changes 500-999 lines, ignoring generated files. 🔧 golang labels Dec 18, 2025
Change tests to fail rather than skip when databases are not available.
This ensures CI properly reports failures when database connectivity
issues occur.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
Update the Enabled check for managed-db context to verify at least one
database URI is available before running those tests.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
Keep t.Skip() instead of t.Fatal() in local postgres.go and mysql.go
when database is unavailable. This allows tests to be skipped gracefully
when neither Docker nor native installation is available.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
Add context timeout to prevent apt-get install from blocking indefinitely
when network is unavailable or slow. Uses 60 second timeout for install
and 10 second timeout for debconf setup.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
Use the Linux timeout command instead of context timeout for apt-get
since exec.CommandContext doesn't properly kill child processes when
using sudo. This ensures apt-get is properly terminated after 60 seconds.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
Simplify native database support to only start existing installations
instead of attempting to install databases via apt-get. This makes
the code more reliable and appropriate for CI environments where
databases should be pre-installed via services directives.

Also add CLAUDE.md documentation for manual database installation
with HTTP proxy configuration.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
@kyleconroy kyleconroy merged commit 53b12f9 into main Dec 18, 2025
13 checks passed
@kyleconroy kyleconroy deleted the claude/e2e-tests-no-docker-WA43c branch December 18, 2025 19:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XL This PR changes 500-999 lines, ignoring generated files. 🔧 golang

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants