Skip to content

Commit

Permalink
Build/Test Tools: Move composer update to env:start.
Browse files Browse the repository at this point in the history
Currently, `composer update` is run whenever `test:php` is called to ensure the latest versions of `yoast/phpunit-polyfills` and other dependencies are always installed when running the PHPUnit test suite. 

For contributors using the local Docker environment to run tests during development, this is unnecessary and can often result in a 30+ second delay every time `test:php` is called.

This moves the command to `env:install`, reducing the number of times `composer update` is run from many to once. Since the environment needs to be started in order to run tests, `env:install` will still confirm that the latest versions of required dependencies are installed and available prior to running the test suite.

Props azaozz, swissspidy, johnbillion, peterwilsoncc, hellofromtonya.
Fixes #57189.

git-svn-id: https://develop.svn.wordpress.org/trunk@59231 602fd350-edb4-49c9-b593-d223f7449a82
  • Loading branch information
desrosj committed Oct 14, 2024
1 parent 1c4df1d commit b4682e1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@
"grunt": "grunt",
"lint:jsdoc": "wp-scripts lint-js",
"lint:jsdoc:fix": "wp-scripts lint-js --fix",
"env:start": "node ./tools/local-env/scripts/start.js",
"env:start": "node ./tools/local-env/scripts/start.js && node ./tools/local-env/scripts/docker.js run -T php composer update -W",
"env:stop": "node ./tools/local-env/scripts/docker.js down",
"env:restart": "npm run env:stop && npm run env:start",
"env:clean": "node ./tools/local-env/scripts/docker.js down -v --remove-orphans",
Expand All @@ -189,7 +189,7 @@
"env:logs": "node ./tools/local-env/scripts/docker.js logs",
"env:pull": "node ./tools/local-env/scripts/docker.js pull",
"test:performance": "wp-scripts test-playwright --config tests/performance/playwright.config.js",
"test:php": "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",
"test:php": "node ./tools/local-env/scripts/docker.js run php ./vendor/bin/phpunit",
"test:e2e": "wp-scripts test-playwright --config tests/e2e/playwright.config.js",
"test:visual": "wp-scripts test-playwright --config tests/visual-regression/playwright.config.js",
"sync-gutenberg-packages": "grunt sync-gutenberg-packages",
Expand Down

0 comments on commit b4682e1

Please sign in to comment.