Opened 8 months ago
Last modified 4 weeks ago
#48301 new enhancement
Backport the simplified local environment
| Reported by: |
|
Owned by: | |
|---|---|---|---|
| Milestone: | Future Release | Priority: | normal |
| Severity: | normal | Version: | |
| Component: | Build/Test Tools | Keywords: | needs-testing has-patch |
| Focuses: | Cc: |
Description
This is a continuation ticket of #47767.
In that ticket, a Docker-based local WordPress Development environment was added to trunk.
This ticket is being opened to accomplish the 3rd goal listed on the ticket, It should be simple to backport to old branches, so we can more easily set up test environments when backporting patches to old branches.
https://core.trac.wordpress.org/ticket/47767#comment:6 has an initial proof of concept for backporting the environment to 3.7, though it needs to be updated to account for the changes made further down in the ticket.
Change History (11)
This ticket was mentioned in PR #125 on WordPress/wordpress-develop by desrosj.
5 months ago
This ticket was mentioned in PR #133 on WordPress/wordpress-develop by desrosj.
5 months ago
This ticket was mentioned in PR #134 on WordPress/wordpress-develop by desrosj.
5 months ago
This ticket was mentioned in PR #135 on WordPress/wordpress-develop by desrosj.
5 months ago
This ticket was mentioned in PR #136 on WordPress/wordpress-develop by desrosj.
5 months ago
This ticket was mentioned in PR #137 on WordPress/wordpress-develop by desrosj.
5 months ago
#8
@
5 months ago
Experimented with changing npm ci to npm install in the 5.2 branch. It fixed the timeout issue with the PHP 7.3 job, but introduced a new error for the 5.6 job: cb() never called!.
Also, here is a link to the Docker image for PHPUnit on PHP 7.1 loading PHPUnit 7: https://hub.docker.com/layers/wordpressdevelop/phpunit/7.1-fpm/images/sha256-7c8bccf4a538f8918c9223904cf1d59ff9811eba2836ef83391986659eb7afd5
Moving forward as support for newer versions of PHPUnit is added, there will likely be a need for more granularity here. @pento any thoughts on how to handle this?
#9
@
3 months ago
noisysocks commented on PR #133:
Test test test
I finally got some working branches pushed to my GitHub fork. You can find the PRs linked above.
I started by only going back to 4.8. At this point, I stop encountering new problems. Solving these first will most likely make going back further go much more smoothly.
For each
.envfile, I have changedLOCAL_PHP-latestto load the highest version of PHP supported by that branch as the default to prevent any potential issues as newerlatestbuilds are released. TheLOCAL_MYSQLversions in the.envfiles need to be updated in the same fashion. I have been less involved in the MySQL version support changes, so I need to research when support for each new MySQL version was added.I think making a MySQL version support page like the one for PHP versions would be very useful.
Some Notes
dotenv,dotenv-expand, andwait-on) and update thenpm-shrinkwrap.jsonfile correctly, I ran `npm install --save-dev --save-exact packagename@1.0.0.npm-shrinkwarp-jsonfile will causefseventsto be re-added. This needs to be manually removed to avoid compatibility issues with non MacOS servers (including Travis, Docker, and the build server). See #38657.npm cidoes not appear to work on branches < 5.0. I switched the command tonpm install.Issues:
A few of the pull request Travis jobs are failing due to a time out when running
npm ci. I'm not sure why as these jobs pass on my fork.5.1 Branch
PHP 7.3, 7.2, 7.1: For some reason, the
Tests_Image_Editor_Imagick::test_rotateandTests_Image_Editor_Imagick::test_fliptests are reading the RGB values of the manipulated images incorrectly, getting an off by one value. This issue does not occur locally for me when running the test suite within the Docker container with the same versions configured.PHP 5.4, 5.3, 5.2: The following error is being returned for these jobs:
/usr/local/bin/docker-php-ext-enable: 5: cd: can't cd to /usr/local/lib/php/extensions/no-debug-non-zts-200606135.0 Branch
PHP 7.3=: There is a
Fatal error: Class PHPUnit_Util_Test may not inherit from final class (PHPUnit\Util\Test) in /var/www/tests/phpunit/includes/phpunit6-compat.php on line 18happening. I believe that this is being caused because PHPUnit 7 is packaged in thePHP 7.1-7.3-fpmPHPUnit Docker images, but WordPress 5.0 only supported up to PHPUnit 6.PHP 5.2: The same error is being encountered as PHP 5.4-5.2 above.
4.9 Branch
The
wait-on >= 3.0.0NPM package does not support NPM 6.9.1, which is the version used in this branch. Downgrading the package to2.1.2seems to work, but there is a potentially unrelated JavaScript error:/home/travis/build/desrosj/wordpress-develop/tools/local-env/scripts/install.js:33 .then( () => { TypeError: Cannot read property 'then' of undefined at ObjectThis could also just be a compatibility issue with the
install.jsscript and NPM 6.9.1.For PHP 5.2, The same error is being caused above.
4.8 Branch
The same issues described for 4.9 also occur in this branch.