Make WordPress Core

Ticket #50042: 50042.4.diff

File 50042.4.diff, 8.7 KB (added by desrosj, 5 years ago)
  • .env

     
    33#
    44# All of these options can be overridden by setting them as environment variables before starting
    55# the environment. You will need to restart your environment when changing any of these.
     6#
     7# Below, the following substitutions can be made:
     8# - '{version}': any major.minor PHP version from 5.2 onwards.
     9# - '{phpunit_version}': any major PHPUnit version starting with 4.
    610##
    711
    812# The site will be available at http://localhost:LOCAL_PORT
     
    1115# Where to run WordPress from. Valid options are 'src' and 'build'.
    1216LOCAL_DIR=src
    1317
    14 # The PHP version to use. Valid options are 'latest', and '{version}-fpm', where '{version}' is any
    15 # x.y PHP version from 5.2 onwards.
     18# The PHP version to use. Valid options are 'latest', and '{version}-fpm'.
    1619LOCAL_PHP=latest
    1720
     21##
     22# The PHPUnit version to use when running tests.
     23#
     24# Support for new PHPUnit versions is not backported to past versions, so some old WordPress branches require an older
     25# version to run tests.
     26#
     27# Valid versions are:
     28# - 'latest' for the highest version of PHPUnit supported on the highest version of PHP supported.
     29# - '{version}-fpm' for the highest version of PHPUnit supported on the specified version of PHP.
     30# - '{phpunit_version}-php-{version}-fpm' for a specific version of PHPUnit on the specified version of PHP. This format
     31# is only available for PHP versions 5.6 and higher.
     32#
     33# For the full list of available options, see https://hub.docker.com/r/wordpressdevelop/phpunit/tags.
     34#
     35# For full documentation on PHPUnit compatibility and WordPress versions, see
     36# https://make.wordpress.org/core/handbook/references/phpunit-compatibility-and-wordpress-versions/.
     37#
     38# This defaults to the value assigned to the value of LOCAL_PHP.
     39##
     40LOCAL_PHPUNIT=${LOCAL_PHP}
     41
    1842# Whether or not to enable XDebug.
    1943LOCAL_PHP_XDEBUG=false
    2044
  • .travis.yml

     
    2929
    3030jobs:
    3131  include:
    32   - env: WP_TRAVISCI=test:e2e PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=
     32  - env: WP_TRAVISCI=test:e2e LOCAL_PHPUNIT=latest PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=
    3333    name: E2E Tests
    3434  - env: WP_TRAVISCI=lint:php COMPOSER_INSTALL=true NPM_INSTALL=false WP_INSTALL=false
    3535    name: PHP Linting
     
    3737    name: "PHP Compatibility Check"
    3838  - env: WP_TRAVISCI=travis:js WP_INSTALL=false PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=
    3939    name: JS Tests
    40   - env: LOCAL_PHP=8.0-fpm COMPOSER_INSTALL=true WP_TRAVISCI=test:php
     40  - env: LOCAL_PHP=8.0-fpm LOCAL_PHPUNIT=8.0-fpm COMPOSER_INSTALL=true WP_TRAVISCI=test:php
    4141    name: "PHPUnit Tests: PHP 8.0"
    4242    script:
    4343      # The PHPUnit 7.x phar is not compatible with PHP 8 and won't be updated,
     
    5353      # Once Xdebug 3.0 is released and included in the Docker image, this should be uncommented again.
    5454      # - LOCAL_PHP_XDEBUG=true docker-compose run --rm phpunit phpunit -v --group xdebug --exclude-group __fakegroup__
    5555
    56   - env: LOCAL_PHP=7.4-fpm WP_TRAVISCI=test:php
     56  - env: LOCAL_PHP=7.4-fpm LOCAL_PHPUNIT=7.4-fpm WP_TRAVISCI=test:php
    5757    name: "PHPUnit Tests: PHP 7.4"
    58   - env: LOCAL_PHP=7.3-fpm WP_TRAVISCI=test:php
     58  - env: LOCAL_PHP=7.3-fpm LOCAL_PHPUNIT=7.3-fpm WP_TRAVISCI=test:php
    5959    name: "PHPUnit Tests: PHP 7.3"
    60   - env: LOCAL_PHP=7.3-fpm LOCAL_PHP_MEMCACHED=true WP_TRAVISCI=test:php
     60  - env: LOCAL_PHP=7.3-fpm LOCAL_PHPUNIT=7.3-fpm LOCAL_PHP_MEMCACHED=true WP_TRAVISCI=test:php
    6161    name: "PHPUnit Tests: PHP 7.3 with Memcached"
    62   - env: LOCAL_PHP=7.2-fpm WP_TRAVISCI=test:php
     62  - env: LOCAL_PHP=7.2-fpm LOCAL_PHPUNIT=7.2-fpm WP_TRAVISCI=test:php
    6363    name: "PHPUnit Tests: PHP 7.2"
    64   - env: LOCAL_PHP=7.1-fpm WP_TRAVISCI=test:php
     64  - env: LOCAL_PHP=7.1-fpm LOCAL_PHPUNIT=7.1-fpm WP_TRAVISCI=test:php
    6565    name: "PHPUnit Tests: PHP 7.1"
    66   - env: LOCAL_PHP=7.0-fpm WP_TEST_REPORTER=true WP_TRAVISCI=test:php
     66  - env: LOCAL_PHP=7.0-fpm LOCAL_PHPUNIT=7.0-fpm WP_TEST_REPORTER=true WP_TRAVISCI=test:php
    6767    name: "PHPUnit Tests: PHP 7.0"
    68   - env: LOCAL_PHP=5.6-fpm WP_TRAVISCI=test:php
     68  - env: LOCAL_PHP=5.6-fpm LOCAL_PHPUNIT=5.6-fpm WP_TRAVISCI=test:php
    6969    name: "PHPUnit Tests: PHP 5.6"
    7070  allow_failures:
    7171  fast_finish: true
  • docker-compose.yml

     
    9696  # The PHPUnit container.
    9797  ##
    9898  phpunit:
    99     image: wordpressdevelop/phpunit:${LOCAL_PHP-latest}
     99    image: wordpressdevelop/phpunit:${LOCAL_PHPUNIT-latest}
    100100
    101101    networks:
    102102      - wpdevnet
  • package-lock.json

     
    91359135                        }
    91369136                },
    91379137                "dotenv": {
    9138                         "version": "8.1.0",
    9139                         "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-8.1.0.tgz",
    9140                         "integrity": "sha512-GUE3gqcDCaMltj2++g6bRQ5rBJWtkWTmqmD0fo1RnnMuUqHNCt2oTPeDnS9n6fKYvlhn7AeBkb38lymBtWBQdA==",
     9138                        "version": "8.2.0",
     9139                        "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-8.2.0.tgz",
     9140                        "integrity": "sha512-8sJ78ElpbDJBHNeBzUbUVLsqKdccaa/BXF1uPTw3GrvQTBgrQrtObr2mUrE38vzYd8cEv+m/JBfDLioYcfXoaw==",
    91419141                        "dev": true
    91429142                },
    91439143                "dotenv-expand": {
     
    2520125201                                "tar-stream": "^2.0.0"
    2520225202                        },
    2520325203                        "dependencies": {
     25204                                "base64-js": {
     25205                                        "version": "1.3.1",
     25206                                        "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.3.1.tgz",
     25207                                        "integrity": "sha512-mLQ4i2QO1ytvGWFWmcngKO//JXAQueZvwEKtjgQFM4jIK0kU+ytMfplL8j+n5mspOfjHwoAg+9yhb7BwAHm36g==",
     25208                                        "dev": true
     25209                                },
    2520425210                                "bl": {
    2520525211                                        "version": "4.0.3",
    2520625212                                        "resolved": "https://registry.npmjs.org/bl/-/bl-4.0.3.tgz",
     
    2521325219                                        }
    2521425220                                },
    2521525221                                "buffer": {
    25216                                         "version": "5.6.0",
    25217                                         "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.6.0.tgz",
    25218                                         "integrity": "sha512-/gDYp/UtU0eA1ys8bOs9J6a+E/KWIY+DZ+Q2WESNUA0jFRsJOc0SNUO6xJ5SGA1xueg3NL65W6s+NY5l9cunuw==",
     25222                                        "version": "5.7.0",
     25223                                        "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.7.0.tgz",
     25224                                        "integrity": "sha512-cd+5r1VLBwUqTrmnzW+D7ABkJUM6mr7uv1dv+6jRw4Rcl7tFIFHDqHPL98LhpGFn3dbAt3gtLxtrWp4m1kFrqg==",
    2521925225                                        "dev": true,
    2522025226                                        "requires": {
    25221                                                 "base64-js": "^1.0.2",
    25222                                                 "ieee754": "^1.1.4"
     25227                                                "base64-js": "^1.3.1",
     25228                                                "ieee754": "^1.1.13"
    2522325229                                        }
    2522425230                                },
    2522525231                                "readable-stream": {
  • package.json

     
    3535                "check-node-version": "4.0.1",
    3636                "copy-webpack-plugin": "^5.1.1",
    3737                "cssnano": "4.1.10",
    38                 "dotenv": "8.1.0",
     38                "dotenv": "8.2.0",
    3939                "dotenv-expand": "5.1.0",
    4040                "grunt": "~1.1.0",
    4141                "grunt-banner": "^0.6.0",
  • tools/local-env/scripts/docker.js

     
    1 const dotenv = require( 'dotenv' );
     1const dotenv       = require( 'dotenv' );
     2const dotenvExpand = require( 'dotenv-expand' );
    23const { execSync } = require( 'child_process' );
    3 dotenv.config();
     4
     5dotenvExpand( dotenv.config() );
    46
    57// Execute any docker-compose command passed to this script.
    68execSync( 'docker-compose ' + process.argv.slice( 2 ).join( ' ' ), { stdio: 'inherit' } );
  • tools/local-env/scripts/install.js

     
    1 const dotenv = require( 'dotenv' );
     1const dotenv       = require( 'dotenv' );
     2const dotenvExpand = require( 'dotenv-expand' );
    23const wait_on = require( 'wait-on' );
    34const { execSync } = require( 'child_process' );
    45const { renameSync, readFileSync, writeFileSync } = require( 'fs' );
    56
    6 dotenv.config();
     7dotenvExpand( dotenv.config() );
    78
    89// Create wp-config.php.
    910wp_cli( 'config create --dbname=wordpress_develop --dbuser=root --dbpass=password --dbhost=mysql --path=/var/www/src --force' );
  • tools/local-env/scripts/start.js

     
    1 const dotenv = require( 'dotenv' );
     1const dotenv       = require( 'dotenv' );
     2const dotenvExpand = require( 'dotenv-expand' );
    23const { execSync } = require( 'child_process' );
    34
    4 dotenv.config();
     5dotenvExpand( dotenv.config() );
    56
    67// Start the local-env containers.
    78execSync( 'docker-compose up -d wordpress-develop', { stdio: 'inherit' } );