[wp-trac] [WordPress Trac] #53945: Local test workflow changes for installing Composer dependencies
WordPress Trac
noreply at wordpress.org
Thu Sep 2 22:57:53 UTC 2021
#53945: Local test workflow changes for installing Composer dependencies
------------------------------------------------+--------------------------
Reporter: hellofromTonya | Owner: johnbillion
Type: task (blessed) | Status: reopened
Priority: normal | Milestone: 5.9
Component: Build/Test Tools | Version:
Severity: normal | Resolution:
Keywords: has-patch has-testing-instructions | Focuses:
------------------------------------------------+--------------------------
Comment (by azaozz):
Replying to [comment:28 hellofromTonya]:
> I think the disconnect is this: the recommended command for running
tests locally is `npm run test:php`, not `npm run test:php-composer`. This
works for those using npm/Docker workflow too.
> ...
> However, we've changed this as the PHPUnit phar is no longer loaded in
the container and instead is installed via Composer.
As far as I see PHPUnit is always installed in /vendor when installing the
(other) dependencies, either with local Composer or by `npm run
env:install`. If that's correct, for simplicity's sake perhaps better to
always run it from there? Then the `test:php-composer` command won't be
needed.
> Replying to [comment:27 jrf]:
> > There also seems to be a misconception: "Running the `composer
update/install` command would slow down the general install".
> > While this is true in a situation when an install/update is actually
needed (mismatch between the versions installed and the current PHP
version), if there is no version mismatch, the command will just say
"nothing to update" and move on, so for ''most'' users, the slowdown would
barely be noticeable.
>
> The time it takes depends upon a contributor's internet download speed
as well as if there are any blips in the connectivity chain. While for
many, it may be super duper fast, there is a potential for some
contributors that it slows them down.
Right. I'm also noticing a delay of about 2.5-3 min every time the tests
are run with `npm run test:php` or `npm run test:php-composer`. It happens
after `Use the 'composer fund' command to find out more!` so presuming
after composer has checked for updates. However skipping `composer update
-W` and running only `% node ./tools/local-env/scripts/docker.js run --rm
phpunit phpunit "--group" "formatting"` doesn't trigger that delay.
That ~3 min delay is pretty annoying especially when writing or fixing
tests and running the same test 10-20 times in a row. Even if it's fixed,
perhaps Composer updates should not be running every time PHPUnit is run,
still takes 5-10 sec to check :)
{{{
> WordPress at 5.9.0 test:php /Users/andrew/dev/wp/trunk
> node ./tools/local-env/scripts/docker.js run -T php composer update -W
&& node ./tools/local-env/scripts/docker.js run --rm phpunit phpunit "--
group" "formatting"
Starting trunk-wpenv_mysql_1 ... done
Loading composer repositories with package information
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
26 packages you are using are looking for funding.
Use the `composer fund` command to find out more!
----------> delay happen here <---------
Starting trunk-wpenv_mysql_1 ... done
Installing...
Running as single site... To run multisite, use -c
tests/phpunit/multisite.xml
Not running ajax tests. To execute these, use --group ajax.
Not running ms-files tests. To execute these, use --group ms-files.
Not running external-http tests. To execute these, use --group external-
http.
PHPUnit 7.5.20 by Sebastian Bergmann and contributors.
............................................................. 61 / 1473
( 4%)
...
}}}
--
Ticket URL: <https://core.trac.wordpress.org/ticket/53945#comment:31>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list