Make WordPress Core

Changeset 45783 for trunk/.travis.yml


Ignore:
Timestamp:
08/12/2019 08:28:33 AM (6 years ago)
Author:
pento
Message:

Build Tools: Miscellaneous local-env improvements.

  • Move the functionality for controlling local-env out of package.json, into JS scripts.
  • Merge the docker-compose config files, and move it to the root directory. This allows docker-compose.override.yml to work for local overrides.
  • Fix nginx redirecting to port 80 under some circumstances.
  • npm run env:install now creates wp-tests.config.php for you.
  • Cleaned up a bunch of cruft in .travis.yml.

See #47767.

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk

    • Property svn:ignore
      •  

        old new  
        1414jsdoc
        1515vendor
         16docker-compose.override.yml
  • trunk/.travis.yml

    r45762 r45783  
    1 language: php
     1language: generic
     2
    23services:
    34  - docker
    4   - mysql
    55
    66addons:
     
    5252- |
    5353  if [[ "$WP_TRAVISCI" == "test:php" ]]; then
    54       cp wp-tests-config-sample.php wp-tests-config.php
    55       sed -i "s/youremptytestdbnamehere/wordpress_develop_tests/" wp-tests-config.php
    56       sed -i "s/yourusernamehere/root/" wp-tests-config.php
    57       sed -i "s/yourpasswordhere/password/" wp-tests-config.php
    58       sed -i "s/localhost/mysql/" wp-tests-config.php
    59       echo "define( 'FS_METHOD', 'direct' );" >> wp-tests-config.php
    6054      travis_retry svn checkout https://plugins.svn.wordpress.org/wordpress-importer/tags/0.6.3/ tests/phpunit/data/plugins/wordpress-importer
    6155  fi
     
    7569  fi
    7670- |
    77   # Export Composer's global bin dir to PATH:
    78   composer config --list --global
    79   export PATH=`composer config --list --global | grep '\[home\]' | { read a; echo "${a#* }/vendor/bin:$PATH"; }`
    80 - |
    81   # Install PHPUnit for the tests that don't run in Docker.
    82   if [[ "$WP_TRAVISCI" == "travis:phpunit" ]]; then
    83     echo "Using PHPUnit 7.x"
    84     travis_retry composer global require "phpunit/phpunit:^7"
    85   fi
    86 - |
    8771  # We only need to run composer install on the PHP coding standards job.
    8872  if [[ "$WP_TRAVISCI" == "travis:phpcs" ]]; then
     
    9983    npm run env:start
    10084    npm run build
    101     docker-compose -f tools/local-env/docker-compose.yml run --rm mysql mysql --version
    102     docker-compose -f tools/local-env/docker-compose.yml run --rm php php --version
    103     docker-compose -f tools/local-env/docker-compose.yml run --rm php php -m
    104     docker-compose -f tools/local-env/docker-compose.yml -f tools/local-env/docker-compose.scripts.yml run --rm phpunit phpunit --version
     85    docker-compose run --rm mysql mysql --version
     86    docker-compose run --rm php php --version
     87    docker-compose run --rm php php -m
     88    docker-compose run --rm phpunit phpunit --version
    10589  fi
    10690- |
    10791  if [[ "$LOCAL_PHP_MEMCACHED" == "true" ]]; then
    10892    cp tests/phpunit/includes/object-cache.php build/wp-content/object-cache.php
    109     docker run --name memcached --net local-env_wpdevnet -d memcached
     93    # The memcached server needs to start after `npm run env:start`, which sets up the Docker network.
     94    docker run --name memcached --net wordpress-develop_wpdevnet -d memcached
    11095  fi
    11196- |
    112   if [[ "$WP_TRAVISCI" == "test:e2e" ]]; then
     97  if [[ "$WP_TRAVISCI" == "test:e2e" ]] || [[ "$WP_TRAVISCI" == "test:php" ]]; then
     98    # Run the install process after memcached has started.
    11399    npm run env:install
    114100  fi
     
    125111      npm run test:e2e
    126112    elif [[ "$WP_TRAVISCI" == "test:php" ]]; then
    127       npm run test:php -- -- -- --verbose -c phpunit.xml.dist &&
    128       npm run test:php -- -- -- --verbose -c phpunit.xml.dist --group ajax &&
    129       npm run test:php -- -- -- --verbose -c tests/phpunit/multisite.xml &&
    130       npm run test:php -- -- -- --verbose -c tests/phpunit/multisite.xml --group ms-files &&
    131       npm run test:php -- -- -- --verbose -c phpunit.xml.dist --group external-http &&
    132       npm run test:php -- -- -- --verbose -c phpunit.xml.dist --group restapi-jsclient
     113      npm run test:php -- --verbose -c phpunit.xml.dist &&
     114      npm run test:php -- --verbose -c phpunit.xml.dist --group ajax &&
     115      npm run test:php -- --verbose -c tests/phpunit/multisite.xml &&
     116      npm run test:php -- --verbose -c tests/phpunit/multisite.xml --group ms-files &&
     117      npm run test:php -- --verbose -c phpunit.xml.dist --group external-http &&
     118      npm run test:php -- --verbose -c phpunit.xml.dist --group restapi-jsclient
    133119    else
    134120      npm run grunt $WP_TRAVISCI
     
    139125  if [[ "$WP_TEST_REPORTER" == "true" ]]; then
    140126    git clone https://github.com/WordPress/phpunit-test-runner.git test-runner
    141     export WPT_PREPARE_DIR=$(pwd)
    142     export WPT_TEST_DIR=$(pwd)
    143     php test-runner/report.php
     127    docker-compose run --rm -e WPT_PREPARE_DIR=/var/www -e WPT_TEST_DIR=/var/www php php test-runner/report.php
    144128  fi
    145129
Note: See TracChangeset for help on using the changeset viewer.