From 96e4784476e32e942752151a02fac5ad020b8799 Mon Sep 17 00:00:00 2001 From: "Tanner W. Stokes" Date: Tue, 24 Feb 2026 16:22:07 -0500 Subject: [PATCH 01/19] Attempt to install Docker. --- .buildkite/pipeline.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.buildkite/pipeline.yml b/.buildkite/pipeline.yml index aa4e398c..98ff124e 100644 --- a/.buildkite/pipeline.yml +++ b/.buildkite/pipeline.yml @@ -28,10 +28,16 @@ steps: command: | buildkite-agent artifact download dist.tar.gz . tar -xzf dist.tar.gz + echo "--- :docker: Installing Docker" + curl -fsSL https://get.docker.com | sh + sudo usermod -aG docker $USER + sudo systemctl start docker echo "--- :docker: Starting wp-env" make wp-env-start echo "--- :performing_arts: Running E2E tests" make test-e2e + agents: + queue: default plugins: *plugins - label: ':android: Publish Android Library' From 3d60ca9ded08be9cc4f7d25c8a3825c6e5d95d98 Mon Sep 17 00:00:00 2001 From: "Tanner W. Stokes" Date: Tue, 24 Feb 2026 16:27:19 -0500 Subject: [PATCH 02/19] Don't install Docker because it's reporting that it's already installed. --- .buildkite/pipeline.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.buildkite/pipeline.yml b/.buildkite/pipeline.yml index 98ff124e..1a982cd0 100644 --- a/.buildkite/pipeline.yml +++ b/.buildkite/pipeline.yml @@ -28,10 +28,6 @@ steps: command: | buildkite-agent artifact download dist.tar.gz . tar -xzf dist.tar.gz - echo "--- :docker: Installing Docker" - curl -fsSL https://get.docker.com | sh - sudo usermod -aG docker $USER - sudo systemctl start docker echo "--- :docker: Starting wp-env" make wp-env-start echo "--- :performing_arts: Running E2E tests" From ae64f1a6c3d4483a8d0bc3502571e08f81bf8ace Mon Sep 17 00:00:00 2001 From: David Calhoun Date: Wed, 25 Feb 2026 14:09:53 -0500 Subject: [PATCH 03/19] ci: Add Docker diagnostic logging to E2E step on macOS agent Replace the E2E test commands with Docker availability checks to determine if/where Docker is installed on the mac queue agents. Removes the build-react dependency so the step runs immediately. --- .buildkite/pipeline.yml | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/.buildkite/pipeline.yml b/.buildkite/pipeline.yml index 1a982cd0..d426d84b 100644 --- a/.buildkite/pipeline.yml +++ b/.buildkite/pipeline.yml @@ -24,16 +24,20 @@ steps: plugins: *plugins - label: ':performing_arts: Test Web E2E' - depends_on: build-react command: | - buildkite-agent artifact download dist.tar.gz . - tar -xzf dist.tar.gz - echo "--- :docker: Starting wp-env" - make wp-env-start - echo "--- :performing_arts: Running E2E tests" - make test-e2e - agents: - queue: default + echo "--- :docker: Checking Docker availability" + echo "which docker: $(which docker 2>&1 || echo 'not found')" + echo "PATH: $PATH" + command -v docker && echo "docker found via command -v" || echo "docker NOT found via command -v" + type docker 2>&1 || echo "type docker: not found" + ls -la /usr/local/bin/docker 2>/dev/null || echo "/usr/local/bin/docker: not found" + ls -la /opt/homebrew/bin/docker 2>/dev/null || echo "/opt/homebrew/bin/docker: not found" + ls -la /Applications/Docker.app 2>/dev/null || echo "/Applications/Docker.app: not found" + find /usr/local -name "docker" -type f 2>/dev/null || echo "No docker binary found under /usr/local" + brew list --formula 2>/dev/null | grep -i docker || echo "No docker formula installed via Homebrew" + docker --version 2>&1 || echo "docker --version: failed" + docker compose version 2>&1 || echo "docker compose version: failed" + docker info 2>&1 || echo "docker info: failed" plugins: *plugins - label: ':android: Publish Android Library' From 5766f3cdccb87f187883420d30c2bc49129d6ab3 Mon Sep 17 00:00:00 2001 From: David Calhoun Date: Wed, 25 Feb 2026 14:12:35 -0500 Subject: [PATCH 04/19] ci: Install Playwright system deps on Linux agent before E2E tests The `default` (Linux) queue has Docker for wp-env but is missing system libraries (libatk, etc.) that Chromium needs. Run `sudo npx playwright install-deps chromium` as a top-level pipeline command to install them via apt-get without interactive prompts. --- .buildkite/pipeline.yml | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/.buildkite/pipeline.yml b/.buildkite/pipeline.yml index d426d84b..5738eafc 100644 --- a/.buildkite/pipeline.yml +++ b/.buildkite/pipeline.yml @@ -24,20 +24,18 @@ steps: plugins: *plugins - label: ':performing_arts: Test Web E2E' + depends_on: build-react command: | - echo "--- :docker: Checking Docker availability" - echo "which docker: $(which docker 2>&1 || echo 'not found')" - echo "PATH: $PATH" - command -v docker && echo "docker found via command -v" || echo "docker NOT found via command -v" - type docker 2>&1 || echo "type docker: not found" - ls -la /usr/local/bin/docker 2>/dev/null || echo "/usr/local/bin/docker: not found" - ls -la /opt/homebrew/bin/docker 2>/dev/null || echo "/opt/homebrew/bin/docker: not found" - ls -la /Applications/Docker.app 2>/dev/null || echo "/Applications/Docker.app: not found" - find /usr/local -name "docker" -type f 2>/dev/null || echo "No docker binary found under /usr/local" - brew list --formula 2>/dev/null | grep -i docker || echo "No docker formula installed via Homebrew" - docker --version 2>&1 || echo "docker --version: failed" - docker compose version 2>&1 || echo "docker compose version: failed" - docker info 2>&1 || echo "docker info: failed" + echo "--- :chromium: Installing Playwright system dependencies" + sudo npx playwright install-deps chromium + buildkite-agent artifact download dist.tar.gz . + tar -xzf dist.tar.gz + echo "--- :docker: Starting wp-env" + make wp-env-start + echo "--- :performing_arts: Running E2E tests" + make test-e2e + agents: + queue: default plugins: *plugins - label: ':android: Publish Android Library' From 3e0d84592305058599484f407d3ff75a5cbaff01 Mon Sep 17 00:00:00 2001 From: David Calhoun Date: Wed, 25 Feb 2026 14:34:52 -0500 Subject: [PATCH 05/19] ci: Add DEBIAN_FRONTEND=noninteractive to Playwright deps install sudo is available on the default Linux queue (Docker install confirmed it), so the hang was likely apt-get prompting interactively. Set DEBIAN_FRONTEND=noninteractive to suppress prompts. --- .buildkite/pipeline.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.buildkite/pipeline.yml b/.buildkite/pipeline.yml index 5738eafc..cb705b7a 100644 --- a/.buildkite/pipeline.yml +++ b/.buildkite/pipeline.yml @@ -27,7 +27,7 @@ steps: depends_on: build-react command: | echo "--- :chromium: Installing Playwright system dependencies" - sudo npx playwright install-deps chromium + sudo DEBIAN_FRONTEND=noninteractive npx playwright install-deps chromium buildkite-agent artifact download dist.tar.gz . tar -xzf dist.tar.gz echo "--- :docker: Starting wp-env" From f4c51f61708873e8f410482c6fc72f9219f0eaaa Mon Sep 17 00:00:00 2001 From: David Calhoun Date: Wed, 25 Feb 2026 14:45:53 -0500 Subject: [PATCH 06/19] ci: Add diagnostics for default Linux queue capabilities Check user/group, sudo access, Docker availability, apt-get access, and Playwright status to determine what the agent can actually do. --- .buildkite/pipeline.yml | 30 +++++++++++++++++++++--------- 1 file changed, 21 insertions(+), 9 deletions(-) diff --git a/.buildkite/pipeline.yml b/.buildkite/pipeline.yml index cb705b7a..a44e4223 100644 --- a/.buildkite/pipeline.yml +++ b/.buildkite/pipeline.yml @@ -24,16 +24,28 @@ steps: plugins: *plugins - label: ':performing_arts: Test Web E2E' - depends_on: build-react command: | - echo "--- :chromium: Installing Playwright system dependencies" - sudo DEBIAN_FRONTEND=noninteractive npx playwright install-deps chromium - buildkite-agent artifact download dist.tar.gz . - tar -xzf dist.tar.gz - echo "--- :docker: Starting wp-env" - make wp-env-start - echo "--- :performing_arts: Running E2E tests" - make test-e2e + echo "--- :mag: Agent diagnostics" + echo "User: $(whoami) (uid=$(id -u), gid=$(id -g))" + echo "Groups: $(groups)" + id + echo "" + echo "--- :lock: sudo check" + sudo -n true 2>&1 && echo "Passwordless sudo: YES" || echo "Passwordless sudo: NO" + echo "" + echo "--- :docker: Docker check" + which docker 2>&1 || echo "which docker: not found" + docker --version 2>&1 || echo "docker --version: failed" + docker info 2>&1 | head -20 || echo "docker info: failed" + docker ps 2>&1 || echo "docker ps: failed" + echo "" + echo "--- :package: Package manager check" + which apt-get 2>&1 || echo "apt-get: not found" + apt-get --version 2>&1 | head -1 || echo "apt-get --version: failed" + dpkg -l libatk1.0-0 2>&1 || echo "libatk1.0-0: not installed" + echo "" + echo "--- :chromium: Playwright check" + npx playwright install --dry-run chromium 2>&1 || echo "playwright dry-run: failed" agents: queue: default plugins: *plugins From b5840299b52b8bcd4c42637b48e3868243f954be Mon Sep 17 00:00:00 2001 From: David Calhoun Date: Wed, 25 Feb 2026 14:50:21 -0500 Subject: [PATCH 07/19] ci: Run Playwright E2E tests inside Docker container The default Linux queue has Docker but no apt-get or sudo, so Playwright's system dependencies (libatk, etc.) cannot be installed on the host. Run the tests inside the official Playwright Docker image which has all system deps pre-installed, using --network host so the container can reach wp-env on localhost:8888 and the Vite preview server on localhost:4173. --- .buildkite/pipeline.yml | 34 +++++++++++++--------------------- 1 file changed, 13 insertions(+), 21 deletions(-) diff --git a/.buildkite/pipeline.yml b/.buildkite/pipeline.yml index a44e4223..6e58cb0b 100644 --- a/.buildkite/pipeline.yml +++ b/.buildkite/pipeline.yml @@ -24,28 +24,20 @@ steps: plugins: *plugins - label: ':performing_arts: Test Web E2E' + depends_on: build-react command: | - echo "--- :mag: Agent diagnostics" - echo "User: $(whoami) (uid=$(id -u), gid=$(id -g))" - echo "Groups: $(groups)" - id - echo "" - echo "--- :lock: sudo check" - sudo -n true 2>&1 && echo "Passwordless sudo: YES" || echo "Passwordless sudo: NO" - echo "" - echo "--- :docker: Docker check" - which docker 2>&1 || echo "which docker: not found" - docker --version 2>&1 || echo "docker --version: failed" - docker info 2>&1 | head -20 || echo "docker info: failed" - docker ps 2>&1 || echo "docker ps: failed" - echo "" - echo "--- :package: Package manager check" - which apt-get 2>&1 || echo "apt-get: not found" - apt-get --version 2>&1 | head -1 || echo "apt-get --version: failed" - dpkg -l libatk1.0-0 2>&1 || echo "libatk1.0-0: not installed" - echo "" - echo "--- :chromium: Playwright check" - npx playwright install --dry-run chromium 2>&1 || echo "playwright dry-run: failed" + buildkite-agent artifact download dist.tar.gz . + tar -xzf dist.tar.gz + echo "--- :docker: Starting wp-env" + make wp-env-start + echo "--- :performing_arts: Running E2E tests in Playwright container" + docker run --rm \ + --network host \ + -v "$(pwd):/work" \ + -w /work \ + -e CI=true \ + mcr.microsoft.com/playwright:v1.58.2-noble \ + bash -c "npm ci && npx playwright install chromium && npx playwright test" agents: queue: default plugins: *plugins From 380fb1b5efffeb556036975d2e9b0eb0e83156d2 Mon Sep 17 00:00:00 2001 From: David Calhoun Date: Wed, 25 Feb 2026 15:00:58 -0500 Subject: [PATCH 08/19] ci: Use --userns=host to allow --network host in Playwright container The default queue has DOCKER_USERNS_REMAP enabled, which prevents --network host. Adding --userns=host disables user namespace remapping for this container so host networking works. --- .buildkite/pipeline.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.buildkite/pipeline.yml b/.buildkite/pipeline.yml index 6e58cb0b..0859a6e1 100644 --- a/.buildkite/pipeline.yml +++ b/.buildkite/pipeline.yml @@ -32,6 +32,7 @@ steps: make wp-env-start echo "--- :performing_arts: Running E2E tests in Playwright container" docker run --rm \ + --userns=host \ --network host \ -v "$(pwd):/work" \ -w /work \ From c7d97b83e71c543e6b83580c9034016cdf6fba96 Mon Sep 17 00:00:00 2001 From: David Calhoun Date: Thu, 26 Feb 2026 07:04:03 -0500 Subject: [PATCH 09/19] ci: Add wp-env diagnostics to debug editor settings 404 Verify Gutenberg plugin installation, check REST API route registration, and test the editor settings endpoint directly before running E2E tests. --- .buildkite/pipeline.yml | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/.buildkite/pipeline.yml b/.buildkite/pipeline.yml index 0859a6e1..696e94ad 100644 --- a/.buildkite/pipeline.yml +++ b/.buildkite/pipeline.yml @@ -30,6 +30,19 @@ steps: tar -xzf dist.tar.gz echo "--- :docker: Starting wp-env" make wp-env-start + echo "--- :mag: Verifying wp-env state" + make wp-env-cli CMD="plugin list" + echo "Checking REST API routes..." + curl -s http://localhost:8888/wp-json/ | node -e " + const data = JSON.parse(require('fs').readFileSync('/dev/stdin','utf8')); + const routes = Object.keys(data.routes || {}).filter(r => r.includes('block-editor')); + if (routes.length) { console.log('wp-block-editor routes found:', routes); } + else { console.log('WARNING: No wp-block-editor routes found!'); } + " + CREDS_FILE=".wp-env.credentials.json" + AUTH_HEADER=$(node -e "console.log(JSON.parse(require('fs').readFileSync('$CREDS_FILE','utf8')).authHeader)") + echo "Testing editor settings endpoint..." + curl -v -H "Authorization: $AUTH_HEADER" http://localhost:8888/wp-json/wp-block-editor/v1/settings 2>&1 | head -30 echo "--- :performing_arts: Running E2E tests in Playwright container" docker run --rm \ --userns=host \ From 0b1a2c32cebea27f0e8703fc2587e5f1ace15603 Mon Sep 17 00:00:00 2001 From: David Calhoun Date: Thu, 26 Feb 2026 07:22:20 -0500 Subject: [PATCH 10/19] ci: Debug wp-env REST API permalink issue The /wp-json/ pretty permalink returns HTML instead of JSON, suggesting rewrite rules aren't working. Test both pretty permalink and ?rest_route= query param approaches, and verify the auth header is being captured correctly. --- .buildkite/pipeline.yml | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/.buildkite/pipeline.yml b/.buildkite/pipeline.yml index 696e94ad..ba6b6a78 100644 --- a/.buildkite/pipeline.yml +++ b/.buildkite/pipeline.yml @@ -32,17 +32,16 @@ steps: make wp-env-start echo "--- :mag: Verifying wp-env state" make wp-env-cli CMD="plugin list" - echo "Checking REST API routes..." - curl -s http://localhost:8888/wp-json/ | node -e " - const data = JSON.parse(require('fs').readFileSync('/dev/stdin','utf8')); - const routes = Object.keys(data.routes || {}).filter(r => r.includes('block-editor')); - if (routes.length) { console.log('wp-block-editor routes found:', routes); } - else { console.log('WARNING: No wp-block-editor routes found!'); } - " - CREDS_FILE=".wp-env.credentials.json" - AUTH_HEADER=$(node -e "console.log(JSON.parse(require('fs').readFileSync('$CREDS_FILE','utf8')).authHeader)") - echo "Testing editor settings endpoint..." - curl -v -H "Authorization: $AUTH_HEADER" http://localhost:8888/wp-json/wp-block-editor/v1/settings 2>&1 | head -30 + echo "Testing pretty permalink REST API..." + curl -sv http://localhost:8888/wp-json/ 2>&1 | head -20 + echo "" + echo "Testing query param REST API..." + curl -s "http://localhost:8888/?rest_route=/" | head -200 + echo "" + echo "Testing editor settings via query param..." + AUTH_HEADER=$(node -e "console.log(JSON.parse(require('fs').readFileSync('.wp-env.credentials.json','utf8')).authHeader)") + echo "Auth header: ${AUTH_HEADER:0:20}..." + curl -sv -H "Authorization: $AUTH_HEADER" "http://localhost:8888/?rest_route=/wp-block-editor/v1/settings" 2>&1 | head -40 echo "--- :performing_arts: Running E2E tests in Playwright container" docker run --rm \ --userns=host \ From 19aa5e5bfa099e7d9c718c988eb595a820795d91 Mon Sep 17 00:00:00 2001 From: David Calhoun Date: Thu, 26 Feb 2026 08:02:45 -0500 Subject: [PATCH 11/19] fix: Write .htaccess directly in wp-env for pretty permalinks wp rewrite structure --hard warns that it cannot generate a .htaccess file inside the wp-env Docker container, leaving Apache without rewrite rules. This causes /wp-json/ requests to 404. Write the standard WordPress .htaccess directly into the container via wp-env run, including the HTTP_AUTHORIZATION passthrough rule so application password auth works through Apache. Also remove CI diagnostic commands now that the root cause is identified. --- .buildkite/pipeline.yml | 12 ------------ bin/wp-env-setup.sh | 18 +++++++++++++++++- 2 files changed, 17 insertions(+), 13 deletions(-) diff --git a/.buildkite/pipeline.yml b/.buildkite/pipeline.yml index ba6b6a78..0859a6e1 100644 --- a/.buildkite/pipeline.yml +++ b/.buildkite/pipeline.yml @@ -30,18 +30,6 @@ steps: tar -xzf dist.tar.gz echo "--- :docker: Starting wp-env" make wp-env-start - echo "--- :mag: Verifying wp-env state" - make wp-env-cli CMD="plugin list" - echo "Testing pretty permalink REST API..." - curl -sv http://localhost:8888/wp-json/ 2>&1 | head -20 - echo "" - echo "Testing query param REST API..." - curl -s "http://localhost:8888/?rest_route=/" | head -200 - echo "" - echo "Testing editor settings via query param..." - AUTH_HEADER=$(node -e "console.log(JSON.parse(require('fs').readFileSync('.wp-env.credentials.json','utf8')).authHeader)") - echo "Auth header: ${AUTH_HEADER:0:20}..." - curl -sv -H "Authorization: $AUTH_HEADER" "http://localhost:8888/?rest_route=/wp-block-editor/v1/settings" 2>&1 | head -40 echo "--- :performing_arts: Running E2E tests in Playwright container" docker run --rm \ --userns=host \ diff --git a/bin/wp-env-setup.sh b/bin/wp-env-setup.sh index f7464810..924c1977 100755 --- a/bin/wp-env-setup.sh +++ b/bin/wp-env-setup.sh @@ -65,7 +65,23 @@ done # --------------------------------------------------------------------------- echo "Flushing rewrite rules..." -npm run --silent wp-env run cli -- wp rewrite structure '/%postname%/' --hard 2>/dev/null +npm run --silent wp-env run cli -- wp rewrite structure '/%postname%/' 2>/dev/null + +echo "Writing .htaccess for pretty permalinks..." +npm run --silent wp-env run wordpress -- sh -c 'cat > /var/www/html/.htaccess << "HTACCESS" +# BEGIN WordPress + +RewriteEngine On +RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}] +RewriteBase / +RewriteRule ^index\.php$ - [L] +RewriteCond %{REQUEST_FILENAME} !-f +RewriteCond %{REQUEST_FILENAME} !-d +RewriteRule . /index.php [L] + +# END WordPress +HTACCESS +' 2>/dev/null # --------------------------------------------------------------------------- # Enable Jetpack blocks module From accf49314b3e6fe0ee70ee9fba5529395a662eac Mon Sep 17 00:00:00 2001 From: David Calhoun Date: Thu, 26 Feb 2026 08:12:10 -0500 Subject: [PATCH 12/19] fix: Use wp eval to write .htaccess with correct permissions The wordpress container's shell user cannot write to /var/www/html/. Use wp eval to write the file from PHP via WP-CLI, which runs with the correct filesystem permissions. --- bin/wp-env-setup.sh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/bin/wp-env-setup.sh b/bin/wp-env-setup.sh index 924c1977..1b8fbe0a 100755 --- a/bin/wp-env-setup.sh +++ b/bin/wp-env-setup.sh @@ -68,7 +68,8 @@ echo "Flushing rewrite rules..." npm run --silent wp-env run cli -- wp rewrite structure '/%postname%/' 2>/dev/null echo "Writing .htaccess for pretty permalinks..." -npm run --silent wp-env run wordpress -- sh -c 'cat > /var/www/html/.htaccess << "HTACCESS" +npm run --silent wp-env run cli -- wp eval ' +$htaccess = << RewriteEngine On @@ -80,7 +81,9 @@ RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] # END WordPress -HTACCESS +HTACCESS; +file_put_contents( ABSPATH . ".htaccess", $htaccess ); +echo ".htaccess written to " . ABSPATH; ' 2>/dev/null # --------------------------------------------------------------------------- From fa0cc52366617e18198d1738cae025397175c367 Mon Sep 17 00:00:00 2001 From: David Calhoun Date: Thu, 26 Feb 2026 09:11:57 -0500 Subject: [PATCH 13/19] fix: Use docker exec as root to write .htaccess Both wp-env run wordpress and wp-env run cli lack write permissions to /var/www/html/. Use docker exec -u 0 (root) on the WordPress container to write the .htaccess file directly. --- bin/wp-env-setup.sh | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/bin/wp-env-setup.sh b/bin/wp-env-setup.sh index 1b8fbe0a..0a50b091 100755 --- a/bin/wp-env-setup.sh +++ b/bin/wp-env-setup.sh @@ -68,8 +68,12 @@ echo "Flushing rewrite rules..." npm run --silent wp-env run cli -- wp rewrite structure '/%postname%/' 2>/dev/null echo "Writing .htaccess for pretty permalinks..." -npm run --silent wp-env run cli -- wp eval ' -$htaccess = << /var/www/html/.htaccess << "HTACCESS" # BEGIN WordPress RewriteEngine On @@ -81,10 +85,8 @@ RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] # END WordPress -HTACCESS; -file_put_contents( ABSPATH . ".htaccess", $htaccess ); -echo ".htaccess written to " . ABSPATH; -' 2>/dev/null +HTACCESS +' # --------------------------------------------------------------------------- # Enable Jetpack blocks module From b7a1475ec5cf82a568b0203d5c6c0d4e8ff019cc Mon Sep 17 00:00:00 2001 From: David Calhoun Date: Thu, 26 Feb 2026 09:46:14 -0500 Subject: [PATCH 14/19] fix: Find wp-env container by published port instead of image name wp-env builds a custom Docker image, so filtering by ancestor=wordpress doesn't match. Filter by publish=8888 instead, which matches the wp-env development site port. Also add diagnostic output on failure. --- bin/wp-env-setup.sh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/bin/wp-env-setup.sh b/bin/wp-env-setup.sh index 0a50b091..4eaf3945 100755 --- a/bin/wp-env-setup.sh +++ b/bin/wp-env-setup.sh @@ -68,11 +68,14 @@ echo "Flushing rewrite rules..." npm run --silent wp-env run cli -- wp rewrite structure '/%postname%/' 2>/dev/null echo "Writing .htaccess for pretty permalinks..." -WP_CONTAINER=$(docker ps -qf "name=wordpress" -f "ancestor=wordpress" | head -1) +WP_CONTAINER=$(docker ps -qf "publish=8888" | head -1) if [ -z "$WP_CONTAINER" ]; then - echo "Error: Could not find WordPress container." + echo "Error: Could not find WordPress container on port 8888." + echo "Running containers:" + docker ps --format "{{.ID}} {{.Image}} {{.Ports}} {{.Names}}" exit 1 fi +echo "Found WordPress container: $WP_CONTAINER" docker exec -u 0 "$WP_CONTAINER" sh -c 'cat > /var/www/html/.htaccess << "HTACCESS" # BEGIN WordPress From 0ee835c10263a24b64f07e2b593b3568fa163885 Mon Sep 17 00:00:00 2001 From: David Calhoun Date: Thu, 26 Feb 2026 10:19:38 -0500 Subject: [PATCH 15/19] test: Add network request logging to image upload test Log all requests, responses, and failures to localhost:8888 during the image upload test to diagnose why media uploads time out in CI. Captures HTTP method, URL, relevant headers (origin, authorization, content-type, CORS headers), and failure reasons. --- e2e/image-upload.spec.js | 53 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) diff --git a/e2e/image-upload.spec.js b/e2e/image-upload.spec.js index 8e1c4635..18c5a43b 100644 --- a/e2e/image-upload.spec.js +++ b/e2e/image-upload.spec.js @@ -13,6 +13,59 @@ const TEST_IMAGE = path.resolve( import.meta.dirname, 'assets/test-image.png' ); test.describe( 'Image Upload', () => { test( 'should upload an image via the Image block', async ( { page } ) => { + // Log all network requests to wp-env for debugging upload issues in CI. + page.on( 'request', ( request ) => { + const url = request.url(); + if ( url.includes( 'localhost:8888' ) ) { + // eslint-disable-next-line no-console + console.log( + `[REQ] ${ request.method() } ${ url } headers=${ JSON.stringify( + Object.fromEntries( + Object.entries( request.headers() ).filter( + ( [ k ] ) => + [ + 'content-type', + 'authorization', + 'origin', + ].includes( k ) + ) + ) + ) }` + ); + } + } ); + page.on( 'response', ( response ) => { + const url = response.url(); + if ( url.includes( 'localhost:8888' ) ) { + // eslint-disable-next-line no-console + console.log( + `[RES] ${ response.status() } ${ url } headers=${ JSON.stringify( + Object.fromEntries( + Object.entries( response.headers() ).filter( + ( [ k ] ) => + [ + 'access-control-allow-origin', + 'access-control-allow-headers', + 'access-control-allow-methods', + ].includes( k ) + ) + ) + ) }` + ); + } + } ); + page.on( 'requestfailed', ( request ) => { + const url = request.url(); + if ( url.includes( 'localhost:8888' ) ) { + // eslint-disable-next-line no-console + console.log( + `[FAIL] ${ request.method() } ${ url } failure=${ + request.failure()?.errorText + }` + ); + } + } ); + const editor = new EditorPage( page ); await editor.setup(); From 368e6411cbacd6338253b2bac2d80b3c0068752d Mon Sep 17 00:00:00 2001 From: David Calhoun Date: Thu, 26 Feb 2026 17:06:14 -0500 Subject: [PATCH 16/19] ci: Dump WordPress debug log and uploads permissions after E2E tests --- .buildkite/pipeline.yml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/.buildkite/pipeline.yml b/.buildkite/pipeline.yml index 0859a6e1..5954c77f 100644 --- a/.buildkite/pipeline.yml +++ b/.buildkite/pipeline.yml @@ -39,6 +39,17 @@ steps: -e CI=true \ mcr.microsoft.com/playwright:v1.58.2-noble \ bash -c "npm ci && npx playwright install chromium && npx playwright test" + E2E_EXIT=$? + echo "--- :wordpress: WordPress debug log" + WP_CONTAINER=$(docker ps -qf "publish=8888" | head -1) + if [ -n "$WP_CONTAINER" ]; then + docker exec "$WP_CONTAINER" cat /var/www/html/wp-content/debug.log 2>/dev/null || echo "(no debug.log found)" + echo "--- :file_folder: Uploads directory permissions" + docker exec "$WP_CONTAINER" ls -la /var/www/html/wp-content/uploads/ 2>/dev/null || echo "(no uploads directory)" + else + echo "(WordPress container not found)" + fi + exit $E2E_EXIT agents: queue: default plugins: *plugins From 98646f7763c365aa1d269afcb7bf68c19fdbcb17 Mon Sep 17 00:00:00 2001 From: David Calhoun Date: Thu, 26 Feb 2026 17:29:08 -0500 Subject: [PATCH 17/19] ci: Prevent script abort so WordPress debug log is captured --- .buildkite/pipeline.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.buildkite/pipeline.yml b/.buildkite/pipeline.yml index 5954c77f..d346c46a 100644 --- a/.buildkite/pipeline.yml +++ b/.buildkite/pipeline.yml @@ -31,6 +31,7 @@ steps: echo "--- :docker: Starting wp-env" make wp-env-start echo "--- :performing_arts: Running E2E tests in Playwright container" + E2E_EXIT=0 docker run --rm \ --userns=host \ --network host \ @@ -38,8 +39,8 @@ steps: -w /work \ -e CI=true \ mcr.microsoft.com/playwright:v1.58.2-noble \ - bash -c "npm ci && npx playwright install chromium && npx playwright test" - E2E_EXIT=$? + bash -c "npm ci && npx playwright install chromium && npx playwright test" \ + || E2E_EXIT=$? echo "--- :wordpress: WordPress debug log" WP_CONTAINER=$(docker ps -qf "publish=8888" | head -1) if [ -n "$WP_CONTAINER" ]; then From ebc7f76da1b3273a0d7d7f52ba63da893de4771d Mon Sep 17 00:00:00 2001 From: David Calhoun Date: Thu, 26 Feb 2026 18:35:24 -0500 Subject: [PATCH 18/19] ci: Fix root-owned files left by Playwright container The --userns=host Playwright container runs as root, creating root-owned files in node_modules/ and e2e/test-results/ that the buildkite-agent user cannot clean up on subsequent builds. Add a post-test chown step to restore ownership. --- .buildkite/pipeline.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.buildkite/pipeline.yml b/.buildkite/pipeline.yml index d346c46a..15ca37a5 100644 --- a/.buildkite/pipeline.yml +++ b/.buildkite/pipeline.yml @@ -41,6 +41,13 @@ steps: mcr.microsoft.com/playwright:v1.58.2-noble \ bash -c "npm ci && npx playwright install chromium && npx playwright test" \ || E2E_EXIT=$? + echo "--- :broom: Fixing ownership of root-owned files" + docker run --rm \ + --userns=host \ + -v "$(pwd):/work" \ + -w /work \ + mcr.microsoft.com/playwright:v1.58.2-noble \ + chown -R "$(id -u):$(id -g)" /work echo "--- :wordpress: WordPress debug log" WP_CONTAINER=$(docker ps -qf "publish=8888" | head -1) if [ -n "$WP_CONTAINER" ]; then From 7cdb8eefb5e81dee6708c740d0a465187bfb34ee Mon Sep 17 00:00:00 2001 From: David Calhoun Date: Thu, 26 Feb 2026 19:37:21 -0500 Subject: [PATCH 19/19] ci: Capture wp-env container ID before Playwright overwrites node_modules --- .buildkite/pipeline.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.buildkite/pipeline.yml b/.buildkite/pipeline.yml index 15ca37a5..d6630385 100644 --- a/.buildkite/pipeline.yml +++ b/.buildkite/pipeline.yml @@ -30,6 +30,7 @@ steps: tar -xzf dist.tar.gz echo "--- :docker: Starting wp-env" make wp-env-start + WP_CONTAINER=$(docker ps -qf "publish=8888" | head -1) echo "--- :performing_arts: Running E2E tests in Playwright container" E2E_EXIT=0 docker run --rm \ @@ -49,13 +50,14 @@ steps: mcr.microsoft.com/playwright:v1.58.2-noble \ chown -R "$(id -u):$(id -g)" /work echo "--- :wordpress: WordPress debug log" - WP_CONTAINER=$(docker ps -qf "publish=8888" | head -1) if [ -n "$WP_CONTAINER" ]; then docker exec "$WP_CONTAINER" cat /var/www/html/wp-content/debug.log 2>/dev/null || echo "(no debug.log found)" echo "--- :file_folder: Uploads directory permissions" docker exec "$WP_CONTAINER" ls -la /var/www/html/wp-content/uploads/ 2>/dev/null || echo "(no uploads directory)" + echo "--- :whale: WordPress container status" + docker inspect --format='{{.State.Status}}' "$WP_CONTAINER" 2>/dev/null || echo "(container gone)" else - echo "(WordPress container not found)" + echo "(WordPress container not found before tests)" fi exit $E2E_EXIT agents: