Make WordPress Core

Changeset 51685


Ignore:
Timestamp:
08/28/2021 09:16:22 PM (3 years ago)
Author:
johnbillion
Message:

Build/Test Tools: Install the Composer package dependencies within the Docker environment as part of the local development environment installation and testing processes.

This makes the use of Composer on the host machine optional when using the Docker environment, which means there is no change to the process for installing, updating, and running the tests since [51559].

Props hellofromTonya, azaozz, netweb, desrosj, jrf, johnbillion

Fixes #53945

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/package.json

    r51443 r51685  
    171171        "env:logs": "node ./tools/local-env/scripts/docker.js logs",
    172172        "env:pull": "node ./tools/local-env/scripts/docker.js pull",
    173         "test:php": "node ./tools/local-env/scripts/docker.js run --rm phpunit phpunit",
    174         "test:php-composer": "node ./tools/local-env/scripts/docker.js run --rm phpunit php ./vendor/bin/phpunit",
     173        "test:php": "node ./tools/local-env/scripts/docker.js run -T php composer update -W && node ./tools/local-env/scripts/docker.js run --rm phpunit phpunit",
     174        "test:php-composer": "node ./tools/local-env/scripts/docker.js run -T php composer update -W && node ./tools/local-env/scripts/docker.js run --rm phpunit php ./vendor/bin/phpunit",
    175175        "test:e2e": "node ./tests/e2e/run-tests.js",
    176176        "wp-packages-update": "wp-scripts packages-update"
  • trunk/tools/local-env/scripts/install.js

    r51179 r51685  
    2222
    2323install_wp_importer();
     24
     25install_composer_dependencies();
    2426
    2527// Read in wp-tests-config-sample.php, edit it to work with our config, then write it to wp-tests-config.php.
     
    5860    execSync( `docker-compose exec -T php git clone https://github.com/WordPress/wordpress-importer.git ${testPluginDirectory} --depth=1`, { stdio: 'inherit' } );
    5961}
     62
     63/**
     64 * Installs the Composer package dependencies within the Docker environment.
     65 */
     66function install_composer_dependencies() {
     67    execSync( `docker-compose run -T php composer update -W`, { stdio: 'inherit' } );
     68}
Note: See TracChangeset for help on using the changeset viewer.