Skip to content

Commit 4da8097

Browse files
committed
feat(dev): replace docker with wp-env
1 parent 28e38e0 commit 4da8097

20 files changed

Lines changed: 52 additions & 158 deletions

.distignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ vendor/openspout/openspout/README.md
2424
.idea
2525
.wordpress-org
2626
.releaserc.yml
27-
docker-compose.ci.yml
2827
CONTRIBUTING.md
2928
artifacts
3029
phpstan.neon

.github/ISSUE_TEMPLATE/agent_task.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ body:
77
attributes:
88
label: Goal / Acceptance Criteria
99
description: "What does 'done' look like? Be specific."
10-
placeholder: "Example: Update E2E docs to use npm run env:up/env:down and ensure credentials match bin/cli-setup.sh."
10+
placeholder: "Example: Update E2E docs to use npm run env:up/env:down and ensure credentials match .wp-env.json."
1111
validations:
1212
required: true
1313

.github/agents/visualizer.agent.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,5 +28,5 @@ You are the Visualizer plugin agent. Follow repository conventions and prioritiz
2828

2929
## Notes
3030

31-
- E2E uses Docker via `docker-compose.ci.yml` and the default URL `http://localhost:8889`.
31+
- E2E uses `@wordpress/env` (config in `.wp-env.json`) and the default URL `http://localhost:8889`.
3232
- If the task is doc-only or non-code, explain why tests were skipped.

.github/workflows/copilot-setup-steps.yml

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -51,13 +51,8 @@ jobs:
5151
- name: Install PHP dependencies
5252
run: composer install --prefer-dist --no-progress
5353

54-
- name: Pre-pull E2E Docker images
55-
run: docker compose -f docker-compose.ci.yml pull
56-
57-
- name: Bootstrap E2E environment
58-
env:
59-
DOCKER_FILE: docker-compose.ci.yml
60-
run: bash bin/wp-init.sh
54+
- name: Bootstrap E2E environment (wp-env)
55+
run: npx wp-env start
6156

6257
- name: Install WordPress test suite
6358
run: bash bin/install-wp-tests.sh wordpress_test root root 127.0.0.1:3306

.github/workflows/test-e2e.yml

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@ concurrency:
1010
jobs:
1111
e2e:
1212
name: Playwright E2E tests
13-
env:
14-
DOCKER_FILE: docker-compose.ci.yml
1513
strategy:
1614
fail-fast: false
1715
runs-on: ubuntu-22.04
@@ -31,9 +29,8 @@ jobs:
3129
npx playwright install --with-deps chromium
3230
- name: Install composer deps
3331
run: composer install --no-dev
34-
- name: Install environment
35-
run: |
36-
npm run env:up
32+
- name: Start wp-env
33+
run: npx wp-env start
3734
- name: Run the tests
3835
run: |
3936
npm run test:e2e:playwright

.wp-env.json

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,18 @@
11
{
22
"core": null,
33
"phpVersion": "7.4",
4-
"plugins": ["."],
4+
"plugins": [
5+
"."
6+
],
57
"themes": [],
68
"config": {
79
"WP_DEBUG": true,
810
"WP_DEBUG_LOG": true,
9-
"SCRIPT_DEBUG": true
11+
"WP_DEBUG_DISPLAY": false,
12+
"SCRIPT_DEBUG": true,
13+
"TI_E2E_TESTING": true
14+
},
15+
"lifecycleScripts": {
16+
"afterStart": "npx wp-env run tests-cli wp plugin install classic-editor elementor --activate && npx wp-env run tests-cli wp theme install twentytwentyone --activate && npx wp-env run tests-cli wp rewrite structure '/%postname%/' --hard && npx wp-env run tests-cli wp option update visualizer_fresh_install 1"
1017
}
1118
}

AGENTS.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,9 @@ This repo includes `.github/workflows/copilot-setup-steps.yml` to preinstall dep
5757
10. `npm run env:down`
5858

5959
### E2E Environment
60-
- Default: Docker via `npm run env:up` / `npm run env:down` (uses `docker-compose.ci.yml`).
61-
- Optional: `wp-env` is supported, but Docker is the default for agents.
60+
- Managed by `@wordpress/env`: `npm run env:up` / `npm run env:down` (configured via `.wp-env.json`).
61+
- Tests instance runs on `http://localhost:8889` with credentials `admin` / `password`.
62+
- Run wp-cli against the tests instance via `npx wp-env run tests-cli wp <command>`.
6263

6364
### Build Outputs
6465
If you change anything under `classes/Visualizer/**/src`, you must run the corresponding build and commit the output:

bin/cli-setup.sh

Lines changed: 0 additions & 22 deletions
This file was deleted.

bin/mysql/init-db.sql

Lines changed: 0 additions & 1 deletion
This file was deleted.

bin/run-e2e-tests-default.sh

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
#!/usr/bin/env bash
22
set -euo pipefail
33

4-
export DOCKER_FILE=${DOCKER_FILE:-docker-compose.ci.yml}
5-
64
npm run env:up
75
npm run test:e2e:playwright
86
npm run env:down

0 commit comments

Comments
 (0)