Honor MySQL contracts in managed PHPUnit - #1995
Merged
Merged
Conversation
This was referenced Jul 23, 2026
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 free
to 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.
Summary
databaseTypecontract to the supported PHPUnit recipe builderDB_*outputswp-tests-config.phpvalues from that service and fail before test execution instead of substituting SQLiteRoot cause and ownership
The component setting never reached WP Codebox: the external PHPUnit adapter reads the caller's settings but does not place
database_typein its builder options. WP Codebox's public PHPUnit builder therefore had no database-backend field, emitted no MySQL service, andwordpress.phpunitunconditionally wroteDB_NAME=':memory:'.This PR owns the WP Codebox boundary by adding the generic
databaseTypebuilder option.databaseType: \"mysql\"now emits an ordinary recipeinputs.servicesMySQL declaration plusdatabase-type=mysql; no caller-specific names or policy enter generic WP Codebox layers. The caller adapter can now map its setting to this public field rather than inventing runtime behavior.Before / after
Before, managed PHPUnit always generated SQLite test constants even when the surrounding component required MySQL. After, explicit MySQL provisions the supported disposable service, exposes its host, port, database, username, and password to Playground, and writes those values into
wp-tests-config.php. Missing external service support produces a precise refusal before the workload runs. OmittingdatabaseTyperetains SQLite compatibility.Verification
npm run build- passednpm run test:runtime-services- passednpx tsx tests/phpunit-project-autoload.test.ts- passednpm run test:disposable-mysql-mysqli-e2e- skipped because Docker is unavailable on this hostgit diff --check- passednpm run check- reached a pre-existing unrelatedcommand-registry-smokefailure:wordpress.collect-workload-result outputShape should mention outputSchema id; production-boundary enforcement, build, and preceding smoke checks passedTests prove explicit MySQL creates canonical service outputs and reaches the managed PHPUnit config, unsupported MySQL refuses SQLite substitution before invoking the workload, and an omitted database contract preserves the in-memory SQLite default.
Addresses #1986.