Repository navigation
Tests: Don't assume the checkout directory is named gutenberg (wp/5.6) - #85709
Conversation
…file. docker-compose fails to start if a volume is listed more than once. That happens when a directory mapping and a plugin source resolve to the same path, such as mapping `wp-content/plugins/gutenberg` to `.` while `.` is also loaded as a plugin from a checkout named `gutenberg`. Backports the `packages/env` part of #39362. (cherry picked from commit 936ce3a) Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…environment.
The PHP unit test commands use the hardcoded path
`/var/www/html/wp-content/plugins/gutenberg`, but wp-env mounts the plugin
under the name of the directory it was checked out into. In a checkout with
any other name, PHPUnit fails with:
Could not read "/var/www/html/wp-content/plugins/gutenberg/phpunit.xml.dist".
Map `wp-content/plugins/gutenberg` to the repository root so the path always
exists.
Backports the `.wp-env.json` part of #39362.
(cherry picked from commit 936ce3a)
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the
|
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. Props Bot commandsYou can trigger Props Bot actions by commenting on this PR:
|
🤖 PR meta 🤖🏷️ LabelsThis pull request needs exactly one label indicating its type, and has 0.
Read more about Type labels in Gutenberg. If you cannot add labels yourself, a reviewer can do it for you. |
|
Size Change: 0 B Total Size: 1.2 MB ℹ️ View Unchanged
|
What?
Removes assumptions that the repository is checked out into a directory named
gutenbergon thewp/5.6branch. One commit per file:wp-content/plugins/gutenbergin the tests environment.Why?
The PHP unit test commands on this branch use the hardcoded path
/var/www/html/wp-content/plugins/gutenberg, but wp-env mounts the plugin under the name of the directory the repository was checked out into. In a checkout with any other name, every PHPUnit job fails before running a test:This backports #39362, which fixed this on
trunkin 2022 and is already present onwp/6.0and later:wp-content/plugins/gutenbergis mapped to the repository root, and wp-env no longer adds duplicate volumes when that mapping and the plugin resolve to the same path (which is the case in a checkout namedgutenberg).This can be encountered in environments that check the repository out under a different directory name, such as private forks.
Testing Instructions
gutenberg.npm ci && npm run build && npm run wp-env start.npm run test-unit-php(andnpm run test-unit-php-multisite). PHPUnit should find its configuration and run.gutenberg,npm run wp-env startshould still start without docker-compose reporting a duplicate volume.🤖 Generated with Claude Code