Skip to content

Fix integration test DB hostname resolution in CI - #55

Merged
tyrsson merged 2 commits into
0.5.xfrom
fix-integration-test-db-hostname
Aug 10, 2026
Merged

Fix integration test DB hostname resolution in CI#55
tyrsson merged 2 commits into
0.5.xfrom
fix-integration-test-db-hostname

Conversation

@tyrsson

@tyrsson tyrsson commented Aug 10, 2026

Copy link
Copy Markdown
Member

What

Adds test-env-json: '{"TESTS_PHPDB_ADAPTER_MYSQL_HOSTNAME":"127.0.0.1"}' to the caller workflow.

Why

Integration tests are failing on every matrix leg in the current CI run (#53/#54) with getaddrinfo for mysql failed: Temporary failure in name resolution. Root cause: the test/mutation-test jobs in the shared workflow run directly on the runner VM (no container: key), so the DB started via the manual docker run step is only reachable via 127.0.0.1 + the mapped port, not the container name — confirmed by GitHub's own docs on service containers. phpunit.xml.dist defaults TESTS_PHPDB_ADAPTER_MYSQL_HOSTNAME to mysql for local Docker Compose dev, where the PHP and MySQL containers share a Compose network (container-to-container, that's a different scenario). Overriding the real env var in CI takes precedence over phpunit.xml.dist's non-forced <env> default — confirmed via PHPUnit's own docs — without touching that file or affecting local dev.

⚠️ Depends on php-db/phpdb-qa-tools#5

That PR adds the test-env-json input this relies on. CI on this PR will fail with "Invalid input, test-env-json is not defined in the referenced workflow" until #5 merges — expected, not a new problem.

tyrsson added 2 commits August 9, 2026 20:05
Integration tests were failing on every matrix leg with 'getaddrinfo for
mysql failed' — the test/mutation-test jobs run directly on the runner
VM (no container:), so the DB is only reachable via 127.0.0.1 + the
mapped port, not the container name 'mysql' that phpunit.xml.dist
defaults to for local Docker Compose dev.

Depends on php-db/phpdb-qa-tools#5 (adds the test-env-json input this
relies on) — CI on this PR will error referencing an undefined input
until that merges.
@tyrsson
tyrsson merged commit 945e711 into 0.5.x Aug 10, 2026
10 of 14 checks passed
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.

1 participant