Changeset 45762
- Timestamp:
- 08/07/2019 11:54:22 AM (6 years ago)
- Location:
- trunk
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/.env
r45745 r45762 19 19 LOCAL_PHP_XDEBUG=false 20 20 21 # Whether or not to enable Memcached. 22 LOCAL_PHP_MEMCACHED=false 23 21 24 # The MySQL version to use. See https://hub.docker.com/_/mysql/ for valid versions. 22 25 LOCAL_MYSQL=5.7 -
trunk/.travis.yml
r45745 r45762 18 18 env: 19 19 global: 20 - LOCAL_DIR =build20 - LOCAL_DIR: build 21 21 22 22 matrix: 23 23 include: 24 24 - env: WP_TRAVISCI=test:e2e 25 name: E2E Tests 25 26 - env: WP_TRAVISCI=travis:phpcs 27 name: PHP Linting 26 28 - env: WP_TRAVISCI=travis:js 29 name: JS Tests 27 30 - env: LOCAL_PHP=7.3-fpm WP_TRAVISCI=test:php 28 - php: 7.3 29 dist: trusty 30 env: WP_TRAVIS_OBJECT_CACHE=true WP_TRAVISCI=travis:phpunit 31 services: memcached 31 name: "PHPUnit Tests: PHP 7.3" 32 - env: LOCAL_PHP=7.3-fpm LOCAL_PHP_MEMCACHED=true WP_TRAVISCI=test:php 33 name: "PHPUnit Tests: PHP 7.3 with Memcached" 32 34 - env: LOCAL_PHP=7.2-fpm WP_TRAVISCI=test:php 35 name: "PHPUnit Tests: PHP 7.2" 33 36 - env: LOCAL_PHP=7.1-fpm WP_TRAVISCI=test:php 37 name: "PHPUnit Tests: PHP 7.1" 34 38 - env: LOCAL_PHP=7.0-fpm WP_TEST_REPORTER=true WP_TRAVISCI=test:php 39 name: "PHPUnit Tests: PHP 7.0" 35 40 - env: LOCAL_PHP=5.6-fpm WP_TRAVISCI=test:php 36 - php: 7.4snapshot 37 dist: trusty 38 env: WP_TRAVISCI=travis:phpunit 39 - php: nightly 40 dist: trusty 41 env: WP_TRAVISCI=travis:phpunit 41 name: "PHPUnit Tests: PHP 5.6" 42 - env: LOCAL_PHP=7.4-fpm WP_TRAVISCI=test:php 43 name: "PHPUnit Tests: PHP 7.4" 44 - env: LOCAL_PHP=8.0-fpm WP_TRAVISCI=test:php 45 name: "PHPUnit Tests: PHP 8.0" 42 46 allow_failures: 43 - php: 7.4snapshot44 - php: nightly47 - env: LOCAL_PHP=7.4-fpm WP_TRAVISCI=test:php 48 - env: LOCAL_PHP=8.0-fpm WP_TRAVISCI=test:php 45 49 fast_finish: true 46 50 47 51 before_install: 48 - |49 if [[ "$WP_TRAVISCI" == "travis:phpunit" ]]; then50 mysql -u root -e "CREATE DATABASE wordpress_tests;"51 cp wp-tests-config-sample.php wp-tests-config.php52 sed -i "s/youremptytestdbnamehere/wordpress_tests/" wp-tests-config.php53 sed -i "s/yourusernamehere/root/" wp-tests-config.php54 sed -i "s/yourpasswordhere//" wp-tests-config.php55 travis_retry svn checkout https://plugins.svn.wordpress.org/wordpress-importer/tags/0.6.3/ tests/phpunit/data/plugins/wordpress-importer56 fi57 52 - | 58 53 if [[ "$WP_TRAVISCI" == "test:php" ]]; then … … 62 57 sed -i "s/yourpasswordhere/password/" wp-tests-config.php 63 58 sed -i "s/localhost/mysql/" wp-tests-config.php 59 echo "define( 'FS_METHOD', 'direct' );" >> wp-tests-config.php 64 60 travis_retry svn checkout https://plugins.svn.wordpress.org/wordpress-importer/tags/0.6.3/ tests/phpunit/data/plugins/wordpress-importer 65 61 fi … … 69 65 chmod +x docker-compose 70 66 sudo mv docker-compose /usr/local/bin 71 - |72 if [[ "$WP_TRAVIS_OBJECT_CACHE" == "true" ]]; then73 cp tests/phpunit/includes/object-cache.php src/wp-content/object-cache.php74 echo "extension = memcached.so" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini75 fi76 67 77 68 before_script: … … 108 99 npm run env:start 109 100 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 105 fi 106 - | 107 if [[ "$LOCAL_PHP_MEMCACHED" == "true" ]]; then 108 cp tests/phpunit/includes/object-cache.php build/wp-content/object-cache.php 109 docker run --name memcached --net local-env_wpdevnet -d memcached 110 110 fi 111 111 - | … … 113 113 npm run env:install 114 114 fi 115 - mysql --version116 - phpenv versions117 - php --version118 - php -m119 115 - npm --version 120 116 - node --version 121 - which phpunit122 - phpunit --version123 117 - curl --version 124 118 - git --version … … 131 125 npm run test:e2e 132 126 elif [[ "$WP_TRAVISCI" == "test:php" ]]; then 133 npm run test:php -- -- -- --verbose -c phpunit.xml.dist 134 npm run test:php -- -- -- --verbose -c phpunit.xml.dist --group ajax 135 npm run test:php -- -- -- --verbose -c tests/phpunit/multisite.xml 136 npm run test:php -- -- -- --verbose -c tests/phpunit/multisite.xml --group ms-files 137 npm run test:php -- -- -- --verbose -c phpunit.xml.dist --group external-http 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 && 138 132 npm run test:php -- -- -- --verbose -c phpunit.xml.dist --group restapi-jsclient 139 133 else -
trunk/package.json
r45745 r45762 148 148 "env:__cli-next": "docker-compose -f ./tools/local-env/docker-compose.yml -f ./tools/local-env/docker-compose.scripts.yml run --rm cli", 149 149 "env:logs": "docker-compose -f ./tools/local-env/docker-compose.yml -f ./tools/local-env/docker-compose.scripts.yml logs", 150 "env:pull": "dotenv npm run env:__pull-next", 151 "env:__pull-next": "docker-compose -f ./tools/local-env/docker-compose.yml -f ./tools/local-env/docker-compose.scripts.yml pull", 150 152 "test:e2e": "dotenv npm run test:__e2e-next", 151 153 "test:__e2e-next": "cross-var cross-env WP_BASE_URL=http://localhost:$LOCAL_PORT wp-scripts test-e2e --config tests/e2e/jest.config.js", -
trunk/tests/phpunit/includes/object-cache.php
r45607 r45762 836 836 $this->servers = $memcached_servers; 837 837 } else { 838 $this->servers = array( array( ' 127.0.0.1', 11211 ) );838 $this->servers = array( array( 'memcached', 11211 ) ); 839 839 } 840 840 -
trunk/tests/phpunit/tests/ajax/CustomizeMenus.php
r45607 r45762 55 55 if ( 'administrator' !== $role ) { 56 56 // If we're not an admin, we should get a wp_die(-1). 57 $this->setExpectedException( 'WPAjaxDieStopException' );57 $this->setExpectedException( 'WPAjaxDieStopException', '-1' ); 58 58 } 59 59 … … 444 444 if ( 'administrator' !== $role ) { 445 445 // If we're not an admin, we should get a wp_die(-1). 446 $this->setExpectedException( 'WPAjaxDieStopException' );446 $this->setExpectedException( 'WPAjaxDieStopException', '-1' ); 447 447 } 448 448 -
trunk/tools/local-env/docker-compose.scripts.yml
r45745 r45762 14 14 environment: 15 15 LOCAL_PHP_XDEBUG: ${LOCAL_PHP_XDEBUG-false} 16 LOCAL_PHP_MEMCACHED: ${LOCAL_PHP_MEMCACHED-false} 16 17 17 18 volumes: … … 32 33 environment: 33 34 LOCAL_PHP_XDEBUG: ${LOCAL_PHP_XDEBUG-false} 35 LOCAL_PHP_MEMCACHED: ${LOCAL_PHP_MEMCACHED-false} 34 36 35 37 volumes: -
trunk/tools/local-env/docker-compose.yml
r45745 r45762 39 39 environment: 40 40 LOCAL_PHP_XDEBUG: ${LOCAL_PHP_XDEBUG-false} 41 LOCAL_PHP_MEMCACHED: ${LOCAL_PHP_MEMCACHED-false} 41 42 42 43 volumes:
Note: See TracChangeset
for help on using the changeset viewer.