Skip to content

Commit dcdd763

Browse files
committed
Added dockerize step to prevent mysql race condition during tests.
1 parent 769b076 commit dcdd763

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

.circleci/config.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,21 @@ references:
2929
composer config -g github-protocols https && composer config -g repo.packagist composer https://packagist.org
3030
rm composer-setup.php
3131
32+
install_dockerize: &install_dockerize
33+
run:
34+
name: Install Dockerize
35+
command: |
36+
wget https://github.com/jwilder/dockerize/releases/download/$DOCKERIZE_VERSION/dockerize-linux-amd64-$DOCKERIZE_VERSION.tar.gz
37+
tar -C /usr/local/bin -xzvf dockerize-linux-amd64-$DOCKERIZE_VERSION.tar.gz
38+
rm dockerize-linux-amd64-$DOCKERIZE_VERSION.tar.gz
39+
environment:
40+
DOCKERIZE_VERSION: v0.6.1
41+
42+
wait_for_mysql: &wait_for_mysql
43+
run:
44+
name: Wait for MySQL
45+
command: dockerize -wait tcp://localhost:3306 -timeout 1m
46+
3247
job_phpunit_base: &job_phpunit_base
3348
docker:
3449
- image: wordpress:php$CONTAINER_PHP_VERSION-fpm-alpine
@@ -41,6 +56,7 @@ references:
4156
working_directory: /root/project/phpcompat
4257
steps:
4358
- run: apk add --no-cache git subversion
59+
- *install_dockerize
4460
- *install_composer
4561
- checkout
4662
- run:
@@ -49,6 +65,7 @@ references:
4965
- *load_composer_cache
5066
- *composer_install
5167
- *save_composer_cache
68+
- *wait_for_mysql
5269
- run:
5370
name: WordPress Test Suite Installation
5471
command: /bin/bash tests/install-wp-tests.sh phpcompat_test phpcompat_user phpcompat_pass 127.0.0.1 $CONTAINER_WP_VERSION true

0 commit comments

Comments
 (0)