[wp-trac] [WordPress Trac] #57189: The PHP tests initialize very slowly in wp-env

WordPress Trac noreply at wordpress.org
Wed Nov 23 20:01:49 UTC 2022


#57189: The PHP tests initialize very slowly in wp-env
------------------------------+--------------------
 Reporter:  azaozz            |      Owner:  (none)
     Type:  defect (bug)      |     Status:  new
 Priority:  normal            |  Milestone:  6.2
Component:  Build/Test Tools  |    Version:
 Severity:  normal            |   Keywords:
  Focuses:                    |
------------------------------+--------------------
 When run in wp-env (Docker), the PHP tests take very long time (over 30
 seconds) to initialize. This is especially annoying/time wasting when
 running them multiple times.

 Not sure if Docker or Composer is the cause, but I see this:
 {{{
 > WordPress at 6.2.0 test:php /dev/wp/trunk
 > node ./tools/local-env/scripts/docker.js run -T php composer update -W
 && node ./tools/local-env/scripts/docker.js run php ./vendor/bin/phpunit

 Creating trunk_php_run ... done
 .................................... (waits here for about 30-35 seconds)
 Loading composer repositories with package information
 Info from https://repo.packagist.org: #StandWithUkraine
 Updating dependencies
 Nothing to modify in lock file
 Installing dependencies from lock file (including require-dev)
 Nothing to install, update or remove
 Generating autoload files
 25 packages you are using are looking for funding.
 Use the `composer fund` command to find out more!
 Creating trunk_php_run ... done
 Installing...
 Running as single site... To run multisite, use -c
 tests/phpunit/multisite.xml
 ..... (rest of the PHPUnit output)
 }}}

 The problem seems to be that Composer is run every time to re-check the
 dependencies, i.e. the script there does the equivalent of `npm i` every
 time before it starts PHPUnit. I understand the desire to keep things
 updated, but this is not productive.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/57189>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list