-
Notifications
You must be signed in to change notification settings - Fork 25
/
docker-compose.test.yml
52 lines (44 loc) · 1.53 KB
/
docker-compose.test.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
version: '2'
services:
db:
image: mysql:5.7
environment:
MYSQL_ROOT_PASSWORD: wordpress
MYSQL_DATABASE: wordpress
MYSQL_USER: wordpress
MYSQL_PASSWORD: wordpress
healthcheck:
test: ["CMD", "mysqladmin" ,"ping", "-pwordpress"]
interval: 5s
timeout: 5s
retries: 10
test:
build: .
depends_on:
db:
condition: service_healthy
volumes:
# Maps the Disqus plugin folder locally to the container filesystem
- "./disqus:/var/www/html/wp-content/plugins/disqus"
- ".:/usr/src/app"
environment:
WORDPRESS_DB_HOST: db:3306
WORDPRESS_DB_PASSWORD: wordpress
WORDPRESS_DEBUG: debug
command: >
bash -e -x -c "
cd /usr/src/app
# We need to re-run these because we're mapping our local copy
# inside the container
echo '=== Installing dependencies ==='
composer install
yarnpkg install
echo '=== Waiting for MySQL to be ready ==='
dockerize -wait tcp://db:3306
echo '=== Configuring WordPress ==='
bin/install-wp-tests.sh wordpress_test root wordpress db latest
echo '=== Running frontend tests ==='
yarnpkg test
echo '=== Running backend tests ==='
bin/test.sh
"