From b4682e141d162350901d5363117fc623c43c8c26 Mon Sep 17 00:00:00 2001 From: Jonathan Desrosiers Date: Mon, 14 Oct 2024 12:36:51 +0000 Subject: [PATCH] Build/Test Tools: Move `composer update` to `env:start`. 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 --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index b49240cff624e..ae5a282bc4407 100644 --- a/package.json +++ b/package.json @@ -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", @@ -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",