1- language : php
1+ language : generic
2+
23services :
34 - docker
4- - mysql
55
66addons :
77 apt :
@@ -51,12 +51,6 @@ matrix:
5151before_install :
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
6256 - |
@@ -73,16 +67,6 @@ before_script:
7367 else
7468 echo "xdebug.ini does not exist"
7569 fi
76- - |
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
8670 - |
8771 # We only need to run composer install on the PHP coding standards job.
8872 if [[ "$WP_TRAVISCI" == "travis:phpcs" ]]; then
@@ -98,18 +82,20 @@ before_script:
9882 if [[ "$WP_TRAVISCI" == "test:e2e" ]] || [[ "$WP_TRAVISCI" == "test:php" ]]; 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
115101 - npm --version
@@ -124,12 +110,12 @@ script:
124110 if [[ "$WP_TRAVISCI" == "test:e2e" ]]; then
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
135121 fi
@@ -138,9 +124,7 @@ after_script:
138124- |
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
146130notifications :
0 commit comments