Uh oh!
There was an error while loading. Please reload this page.
Add test-env-json input (follow-up to #5, missed in that merge) - #6
Merged
Conversation
…tings for CI Confirmed via PHPUnit's docs: <env> in phpunit.xml.dist does not override an already-set real env var unless force="true". This lets a caller override a connection setting (e.g. DB hostname, which needs to differ between local Docker Compose networking and CI's non-containerized job) without editing phpunit.xml.dist or forcing an override that would break local dev. Root cause found via phpdb-mysql's first real CI run: integration tests failed everywhere with 'getaddrinfo for mysql failed' because the test job isn't containerized (runs directly on the runner VM), so the DB started by the manual docker run step is only reachable via 127.0.0.1 and the mapped port, not the container name.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for freeto join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds
test-env-jsoninput (JSON object) exported via$GITHUB_ENVbefore running tests in bothtestandmutation-test. Lets a caller override aphpunit.xml.distconnection setting for CI (e.g. a DB hostname that needs to differ between local Docker Compose networking and CI's non-containerized job) without editing that file.Why
Found via phpdb-mysql's first real CI run: integration tests failed on every leg with
getaddrinfo for mysql failed: Temporary failure in name resolution. Root cause: thetest/mutation-testjobs run directly on the runner VM (nocontainer:key), so the DB started by the manualdocker runstep is only reachable via127.0.0.1+ the mapped port, not the container name — confirmed by GitHub's own docs on service containers. phpdb-mysql'sphpunit.xml.distdefaultsTESTS_PHPDB_ADAPTER_MYSQL_HOSTNAMEtomysqlfor local Docker Compose dev (container-to-container, works fine there). Also confirmed via PHPUnit's docs:<env>does not override an already-set real env var unlessforce="true", so setting the real env var in CI viatest-env-jsoncorrectly takes precedence without needingforce(which would break local dev).Note
This commit was originally pushed onto the
infection-msi-thresholdbranch after#5 had already been merged, so it never actually made it into0.1.xdespite being included in that PR's description. Re-opening it here as its own PR to get it in.php-db/phpdb-mysql#55depends on this.