Fix PHPUnit cache writes through readonly mounts#1805
Merged
Conversation
12659d3 to
40aec34
Compare
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.
Closes #1803
Summary
/tmpfor every WP Codebox PHPUnit invocation.0600on POSIX filesystems.How to test
npm ci && npm run build.npm run test:playground-phpunit-readonly-cache-integration. The test copies the committedtests/fixtures/phpunit-playground-harnessmanifest and lockfile to a temporary directory, runscomposer install --no-interaction --prefer-dist, then executes the built CLI through a realwordpress.phpunitrecipe.npx tsx tests/phpunit-project-autoload.test.ts && npm run test:playground-readonly-mounts && npm run test:playground-readonly-mounts-integration.HOMEBOY_WP_CODEBOX_INSTALL_DIR=/var/empty/wp-codebox HOMEBOY_WP_CODEBOX_BIN=/path/to/wp-codebox/packages/cli/dist/index.js HOMEBOY_WP_CODEBOX_CORE_MODULE=/path/to/wp-codebox/packages/runtime-core/dist/recipe-builders.js bash wordpress/scripts/test/playground-db-activation-smoke.sh.Dependency and network note
The integration requires Composer and network access to install the committed lockfile into a temporary directory. It does not vendor Composer dependencies; normal Composer cache reuse applies. The GitHub workflow installs PHP 8.2/Composer and runs this integration.
Verification
The in-repository integration ran PHPUnit 9.6.34 with wp-phpunit 6.9.4 in actual Playground against a readonly temporary plugin containing a binary sentinel. It asserted
run_testsdiagnostics, no host.phpunit.result.cache, and an unchanged source-tree digest. The downstream canary also passed 3 tests and 7 assertions with an unchanged readonly fixture archive hash.Compatibility
No public API change. WP Codebox does not accept caller-provided PHPUnit result-cache paths. Cache state is internal, per-run, sandbox-private, and cleaned up at PHP shutdown; plugin source mounts remain free of implicit cache writes. Explicit readwrite mount write-back behavior is unchanged.
Dependency and context
This complements #1804 and closes #1803. It validates the real downstream WordPress PHPUnit boundary exercised by Extra-Chill/homeboy-extensions#2257.
AI assistance