-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove PHPUnit and Composer packages #50408
Merged
noahtallen
merged 15 commits into
WordPress:trunk
from
ObliviousHarmony:fix/remove-phpunit-composer-env-containers
May 8, 2023
Merged
Changes from 13 commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
4f484bf
Removed Composer & PHPUnit Containers
ObliviousHarmony 6b8f179
Changelog
ObliviousHarmony e63b56e
Changelog
ObliviousHarmony e3aed37
Replaced `composer` Container References
ObliviousHarmony 62a5d91
Utilized `--env-cwd` Where Useful
ObliviousHarmony dbad506
Secured Composer Install
ObliviousHarmony b929d2e
Fixed Interactive `apt-get install`
ObliviousHarmony 547fa44
Used Relative `--env-cwd` Paths
ObliviousHarmony 9063c1c
Fixed `apt-get` install
ObliviousHarmony cd6cd6b
Update package.json
ObliviousHarmony 1396032
Removed Blank Lines
ObliviousHarmony 6453648
Added Clearer `run` Error Messaging
ObliviousHarmony 20201cb
Fixed Broken Check
ObliviousHarmony cd5cfd8
Update packages/env/lib/commands/run.js
noahtallen 2f98a0d
Update packages/env/lib/commands/run.js
noahtallen File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -168,33 +168,6 @@ module.exports = function buildDockerComposeConfig( config ) { | |
const developmentPorts = `\${WP_ENV_PORT:-${ config.env.development.port }}:80`; | ||
const testsPorts = `\${WP_ENV_TESTS_PORT:-${ config.env.tests.port }}:80`; | ||
|
||
// Defaults are to use the most recent version of PHPUnit that provides | ||
// support for the specified version of PHP. | ||
// PHP Unit is assumed to be for Tests so use the testsPhpVersion. | ||
let phpunitTag = 'latest'; | ||
const phpunitPhpVersion = '-php-' + config.env.tests.phpVersion + '-fpm'; | ||
if ( config.env.tests.phpVersion === '5.6' ) { | ||
phpunitTag = '5' + phpunitPhpVersion; | ||
} else if ( config.env.tests.phpVersion === '7.0' ) { | ||
phpunitTag = '6' + phpunitPhpVersion; | ||
} else if ( config.env.tests.phpVersion === '7.1' ) { | ||
phpunitTag = '7' + phpunitPhpVersion; | ||
} else if ( config.env.tests.phpVersion === '7.2' ) { | ||
phpunitTag = '8' + phpunitPhpVersion; | ||
} else if ( | ||
[ '7.3', '7.4', '8.0', '8.1', '8.2' ].indexOf( | ||
config.env.tests.phpVersion | ||
) >= 0 | ||
) { | ||
phpunitTag = '9' + phpunitPhpVersion; | ||
} | ||
const phpunitImage = `wordpressdevelop/phpunit:${ phpunitTag }`; | ||
|
||
// If the user mounted their own uploads folder, we should not override it in the phpunit service. | ||
const isMappingTestUploads = testsMounts.some( ( mount ) => | ||
mount.endsWith( ':/var/www/html/wp-content/uploads' ) | ||
); | ||
|
||
return { | ||
version: '3.7', | ||
services: { | ||
|
@@ -284,33 +257,12 @@ module.exports = function buildDockerComposeConfig( config ) { | |
WP_TESTS_DIR: '/wordpress-phpunit', | ||
}, | ||
}, | ||
composer: { | ||
image: 'composer', | ||
volumes: [ `${ config.configDirectoryPath }:/app` ], | ||
}, | ||
phpunit: { | ||
image: phpunitImage, | ||
depends_on: [ 'tests-wordpress' ], | ||
volumes: [ | ||
...testsMounts, | ||
...( ! isMappingTestUploads | ||
? [ 'phpunit-uploads:/var/www/html/wp-content/uploads' ] | ||
: [] ), | ||
], | ||
environment: { | ||
LOCAL_DIR: 'html', | ||
WP_TESTS_DIR: '/wordpress-phpunit', | ||
...dbEnv.credentials, | ||
...dbEnv.tests, | ||
}, | ||
}, | ||
}, | ||
volumes: { | ||
...( ! config.env.development.coreSource && { wordpress: {} } ), | ||
...( ! config.env.tests.coreSource && { 'tests-wordpress': {} } ), | ||
mysql: {}, | ||
'mysql-test': {}, | ||
'phpunit-uploads': {}, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm curious why I had to add this in the first place, but I can't remember 🙃 |
||
'user-home': {}, | ||
'tests-user-home': {}, | ||
}, | ||
|
This file contains 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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
so much clearer 😁