[wp-trac] [WordPress Trac] #53945: Local test workflow changes for installing Composer dependencies

WordPress Trac noreply at wordpress.org
Sun Aug 29 01:07:39 UTC 2021

#53945: Local test workflow changes for installing Composer dependencies
 Reporter:  hellofromTonya                       |       Owner:
                                                 |  johnbillion
     Type:  task (blessed)                       |      Status:  closed
 Priority:  normal                               |   Milestone:  5.9
Component:  Build/Test Tools                     |     Version:
 Severity:  normal                               |  Resolution:  fixed
 Keywords:  has-patch has-testing-instructions   |     Focuses:
  commit                                         |

Comment (by jrf):

 Uh oh... commit [51685] has broken the tests from running against PHP

 The reason for this is quite simple: not all PHPUnit dependencies have
 released a version yet which has declared compatibility with PHP 8.1, so
 on PHP 8.1 the `composer update` needs to run with `--ignore-platform-
 requirements` as otherwise PHPUnit 4.8.x will be installed (the last
 PHPUnit version which didn't have version constraints declared).

 Previously in GH Actions, this was (and still is) handled by special
 casing PHP 8.1 in the "Composer install" step, but as the "Install
 WordPress" step is run **after** that step and now runs `composer update`
 as well, the "Install WordPress" step removes the previously installed
 PHPUnit 9.x version and replaces it with PHPUnit 4.x.

 Also see:


 I can currently think of two potential solution directions, though am not
 sure which one is best/feasible:
 1. Presuming the `install.js` script has access to the PHP version on
 which the script is being run (does it ?), special case the command for
 PHP 8.1 to use `--ignore-platform-requirements`.
 2. Presuming the `install.js` script has access to an environment variable
 indicating that it is being run in the context of a GitHub actions run,
 skip the call to `install_composer_dependencies()`.

 We may even need a combination of the two as with solution (1), it would
 be best to remove the "Composer install" step from the GitHub Actions unit
 test and code coverage workflows as that step is now handled via the
 Docker "Install WordPress" step, but on the other hand, if we do that,
 this may break the caching of the Composer downloads in GitHub Actions,
 slowing down the workflows.

 @johnbillion @desrosj @netweb What do think would be the best way to solve
 this ?

Ticket URL: <https://core.trac.wordpress.org/ticket/53945#comment:16>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform

More information about the wp-trac mailing list