Make WordPress Core

Changeset 59231


Ignore:
Timestamp:
10/14/2024 12:36:51 PM (3 months ago)
Author:
desrosj
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/package.json

    r59230 r59231  
    180180        "lint:jsdoc": "wp-scripts lint-js",
    181181        "lint:jsdoc:fix": "wp-scripts lint-js --fix",
    182         "env:start": "node ./tools/local-env/scripts/start.js",
     182        "env:start": "node ./tools/local-env/scripts/start.js && node ./tools/local-env/scripts/docker.js run -T php composer update -W",
    183183        "env:stop": "node ./tools/local-env/scripts/docker.js down",
    184184        "env:restart": "npm run env:stop && npm run env:start",
     
    190190        "env:pull": "node ./tools/local-env/scripts/docker.js pull",
    191191        "test:performance": "wp-scripts test-playwright --config tests/performance/playwright.config.js",
    192         "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",
     192        "test:php": "node ./tools/local-env/scripts/docker.js run php ./vendor/bin/phpunit",
    193193        "test:e2e": "wp-scripts test-playwright --config tests/e2e/playwright.config.js",
    194194        "test:visual": "wp-scripts test-playwright --config tests/visual-regression/playwright.config.js",
Note: See TracChangeset for help on using the changeset viewer.