Build/Test Tools: Allow the desired version of PHPUnit to be passed to the local Docker environment.

This change introduces the `LOCAL_PHPUNIT` environment variable that allows the desired version of PHPUnit to be specified when running the PHP tests within the local Docker environment.

Because support for newer versions of PHPUnit is not backported, some versions of PHP need the ability to run multiple versions of PHPUnit for different branches. This adds the flexibility needed to use the Docker environment within those older branches to run the PHP tests.

Props johnbillion.
Fixes #50042.

git-svn-id: https://develop.svn.wordpress.org/trunk@49358 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Jonathan Desrosiers
2020-10-28 19:01:19 +00:00
parent 72a37d46ac
commit a3bd11826a
7 changed files with 52 additions and 18 deletions

View File

@@ -1,6 +1,8 @@
const dotenv = require( 'dotenv' );
const dotenv = require( 'dotenv' );
const dotenvExpand = require( 'dotenv-expand' );
const { execSync } = require( 'child_process' );
dotenv.config();
dotenvExpand( dotenv.config() );
// Execute any docker-compose command passed to this script.
execSync( 'docker-compose ' + process.argv.slice( 2 ).join( ' ' ), { stdio: 'inherit' } );

View File

@@ -1,9 +1,10 @@
const dotenv = require( 'dotenv' );
const dotenv = require( 'dotenv' );
const dotenvExpand = require( 'dotenv-expand' );
const wait_on = require( 'wait-on' );
const { execSync } = require( 'child_process' );
const { renameSync, readFileSync, writeFileSync } = require( 'fs' );
dotenv.config();
dotenvExpand( dotenv.config() );
// Create wp-config.php.
wp_cli( 'config create --dbname=wordpress_develop --dbuser=root --dbpass=password --dbhost=mysql --path=/var/www/src --force' );

View File

@@ -1,7 +1,8 @@
const dotenv = require( 'dotenv' );
const dotenv = require( 'dotenv' );
const dotenvExpand = require( 'dotenv-expand' );
const { execSync } = require( 'child_process' );
dotenv.config();
dotenvExpand( dotenv.config() );
// Start the local-env containers.
execSync( 'docker-compose up -d wordpress-develop', { stdio: 'inherit' } );