From 83b9937e23d8807b1dee31157e8e7d187d8e0eb0 Mon Sep 17 00:00:00 2001 From: Joey Smith Date: Sun, 9 Aug 2026 20:05:25 -0500 Subject: [PATCH] fix: override DB hostname for CI integration tests MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- .github/workflows/continuous-integration.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index 09b4cf6..c25b527 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -27,6 +27,12 @@ jobs: db-port: "3306" db-env-json: '{"MYSQL_ROOT_HOST":"%","MYSQL_DATABASE":"phpdb_test","MYSQL_ALLOW_EMPTY_PASSWORD":"true"}' db-health-cmd: "mysqladmin ping -h127.0.0.1 --silent" + # 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. phpunit.xml.dist defaults this to + # "mysql" for local Docker Compose dev (container-to-container); this + # overrides it for CI without touching that file. + test-env-json: '{"TESTS_PHPDB_ADAPTER_MYSQL_HOSTNAME":"127.0.0.1"}' enable-codecov: true enable-infection: true # Canonical leg for coverage + mutation testing (highest supported PHP).