Repository navigation
Expand file tree
/
Copy pathcompose.yaml
More file actions
65 lines (63 loc) · 2.12 KB
/
Copy pathcompose.yaml
File metadata and controls
65 lines (63 loc) · 2.12 KB
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
53
54
55
56
57
58
59
60
61
62
63
64
65
# Runs the test runner and a disposable database in containers.
#
# mkdir -p output
# docker compose up --build --abort-on-container-exit --exit-code-from runner
# docker compose down --volumes
#
# Results, logs, and a summary are written to ./output.
#
# The PHP and database versions are set with environment variables, for example:
#
# PHP_VERSION=8.1 WPT_DB_IMAGE=mariadb:10.6 docker compose up --build ...
#
# Any WPT_* variable from .env.default can be passed through the same way.
services:
db:
image: ${WPT_DB_IMAGE:-mysql:8.0}
environment:
MYSQL_ROOT_PASSWORD: root
MYSQL_DATABASE: wordpress_test
MYSQL_USER: wp_test
MYSQL_PASSWORD: wp_test
# The database is destroyed after every run, so keep it in memory.
tmpfs:
- /var/lib/mysql
# Ping over TCP, because the temporary server used while the image creates
# the database and user only listens on the socket. MariaDB 11+ ships
# mariadb-admin instead of mysqladmin.
healthcheck:
test:
- CMD-SHELL
- mysqladmin ping -h 127.0.0.1 -uwp_test -pwp_test || mariadb-admin ping -h 127.0.0.1 -uwp_test -pwp_test
interval: 2s
timeout: 5s
retries: 60
runner:
build:
context: .
dockerfile: docker/Dockerfile
args:
PHP_VERSION: ${PHP_VERSION:-8.3}
NODE_VERSION: ${NODE_VERSION:-24}
WPT_UID: ${WPT_UID:-1000}
depends_on:
db:
condition: service_healthy
environment:
WPT_DB_NAME: wordpress_test
WPT_DB_USER: wp_test
WPT_DB_PASSWORD: wp_test
WPT_DB_HOST: db
WPT_DB_LABEL: ${WPT_DB_IMAGE:-mysql:8.0}
WPT_TABLE_PREFIX: ${WPT_TABLE_PREFIX:-wptests_}
WPT_REPORT_API_KEY: ${WPT_REPORT_API_KEY:-}
WPT_REPORT_URL: ${WPT_REPORT_URL:-}
WPT_FLAVOR: ${WPT_FLAVOR:-0}
WPT_EXTRATESTS: ${WPT_EXTRATESTS:-0}
WPT_PHPUNIT_CMD: ${WPT_PHPUNIT_CMD:-}
WPT_PHPUNIT_ARGS: ${WPT_PHPUNIT_ARGS:-}
WPT_DEBUG: ${WPT_DEBUG:-}
WPT_CERTIFICATE_VALIDATION: ${WPT_CERTIFICATE_VALIDATION:-1}
WPT_IGNORE_TEST_FAILURES: ${WPT_IGNORE_TEST_FAILURES:-}
volumes:
- ./output:/output